Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Aug 6, 2012
1 parent 489b63b commit 65eeb2d
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -100,11 +100,11 @@ public Map<String, String> executeAndGetMapGroovyScript(String scriptContent, Ma
}

logger.info(String.format("Evaluation the following Groovy script content: \n%s\n", scriptContent));
GroovyShell shell = new GroovyShell();
GroovyShell groovyShell = new GroovyShell(Hudson.getInstance().getPluginManager().uberClassLoader);
for (Map.Entry<String, String> entryVariable : envVars.entrySet()) {
shell.setVariable(entryVariable.getKey(), entryVariable.getValue());
groovyShell.setVariable(entryVariable.getKey(), entryVariable.getValue());
}
Object groovyResult = shell.evaluate(scriptContent);
Object groovyResult = groovyShell.evaluate(scriptContent);
if (groovyResult != null && !(groovyResult instanceof Map)) {
throw new EnvInjectException("The evaluated Groovy script must return a Map object.");
}
Expand Down

0 comments on commit 65eeb2d

Please sign in to comment.