Skip to content

Commit

Permalink
https://issues.jenkins-ci.org/browse/JENKINS-16582
Browse files Browse the repository at this point in the history
Adding uberClassLoader to GroovyShell
  • Loading branch information
gcummings committed Jan 31, 2013
1 parent 8f8639d commit f97c997
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -3,6 +3,7 @@
import groovy.lang.GroovyShell;
import hudson.Extension;
import hudson.model.AbstractBuild;
import hudson.model.Hudson;
import org.jenkinsci.plugins.sharedobjects.MultipleSharedObjectType;
import org.jenkinsci.plugins.sharedobjects.SharedObjectException;
import org.jenkinsci.plugins.sharedobjects.SharedObjectType;
Expand Down Expand Up @@ -42,7 +43,7 @@ public Map<String, String> getEnvVars(AbstractBuild build, SharedObjectLogger lo
}

logger.info(String.format("Evaluation the following Groovy script content: \n%s\n", content));
GroovyShell shell = new GroovyShell();
GroovyShell shell = new GroovyShell(Hudson.getInstance().getPluginManager().uberClassLoader);
Object groovyResult = shell.evaluate(content);
if (groovyResult != null && !(groovyResult instanceof Map)) {
throw new SharedObjectException("The evaluated Groovy script must return a Map object.");
Expand Down

0 comments on commit f97c997

Please sign in to comment.