Groovy classloader how put dependent classes on classpath
I made a solution where groovy code is loaded from database dynamically
and executed embedded in our application. Each groovy class implements a java interface.
However the problem is that I want to provide a number of helper classes to be used
from the groovy code. Our applications consist of adf faces and java web services.
I do something like this to load source into class :
GroovyClassLoader gcl = new GroovyClassLoader();
Class clazz;
clazz = gcl.parseClass(sourceCode);
Object obj = clazz.newInstance();
I can put the jars that I want to be available from groovy on the classpath, into
the lib folder of my domain in weblogic and then they are available.
Unfortunately the jars also have dependencies and I find it difficult to control that the dependencies are resolved in the right order.
I can add the jars to my application that loads and invokes the classes, however that does not make the classses visisble to groovy.
How is this normally solved ?