Skip to content
Permalink
Browse files
https://issues.jenkins-ci.org/browse/JENKINS-16582
Adding uberClassLoader to GroovyShell
  • Loading branch information
gcummings committed Jan 31, 2013
1 parent 8f8639d commit f97c997b8c58fcaf6040804b2f075e8af6cc80e4
Showing 1 changed file with 2 additions and 1 deletion.
@@ -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;
@@ -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.");

0 comments on commit f97c997

Please sign in to comment.