-
Improvement
-
Resolution: Fixed
-
Major
-
None
I am unable to import some classes into Shared Objects Groovy Scripts.
[EnvInject] - [ERROR] - SEVERE ERROR occurs: startup failed:
Script1.groovy: 2: unable to resolve class hudson.scm.SubversionSCM
@ line 2, column 1.
import hudson.scm.SubversionSCM;
Initial investigation:
GroovySharedObjectType.java
GroovyShell groovyShell = new GroovyShell()
Looking at how it was implemented in Environment Inject plugin, the following seems to fix my issue:
GroovyShell shell = new GroovyShell(Hudson.getInstance().getPluginManager().uberClassLoader);