InputStream in = new ByteArrayInputStream(bytes);
GroovyCodeSource gcs = new GroovyCodeSource(in, templateName, "/groovy/shell");
GroovyClassLoader loader = new GroovyClassLoader(Thread.currentThread().getContextClassLoader(), config);
Class<?> scriptClass;
try {
scriptClass = loader.parseClass(gcs, false);
} catch (CompilationFailedException e) {
throw new GroovyCompilationException(e, templateText, groovyText);
} catch (ClassFormatError e) {
throw new GroovyCompilationException(e, templateText, groovyText);
}