Hello users@,
I am looking to dynamically load JAR's during a program execution based
upon a users input and therefore using the maven-dependency-plugin to do
Specifically, the plugin configuration looks as follows

This works fine, however I have an issue with regards to these specific
JARs being present on the classpath during the build and runtime depending
on the </scope> I assign to them within the dependency definition.
If I mark the scope as 'runtime', the dependencies are added to the normal
classpath which I do not want, as the purpose here is dynamic classloading
via user input.
On the other hand, if I define the dependency scope as 'provided' then no
transitive dependencies are acquired hence I encounter
java.lang.NoClassDefFoundError as although the primary dependency is
present, it's own dependencies are not.

Does anyone have a way to get around this. Ideally I am looking for a
solution to define a specific location I was dependencies (and the
transitive dependencies) to reside such that I can load them dynamically at
Thank you kindly in advance,


Reply via email to