I wrote a groovy plugin a while back, and am now trying to convert it to a
simple script as it is only used by one artifact and it makes more sense to
keep it with the artifact in question rather than as a separate artifact.
The artifact that uses the script, artifact A, depends on some classes in
artifact B.
I have B setup as a dependency of A, and indeed the script can find classes
from B and use them.
However, when something from B invokes a third party library that tries to
load a class from B I get a java.lang.ClassNotFoundException: .
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
at
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
at
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
at
org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:204)
This is really strange because it doesn't happen when the script is instead
a groovy plugin. There is no change other than that where I used to invoke a
custom plugin, I invoke a groovy script.
50 points for whoever can figure this one out!