Referencing jars during maven hpi:run

2 views
Skip to first unread message

Laurence Bordowitz

unread,
Aug 28, 2015, 1:23:35 PM8/28/15
to Jenkins Developers
Not a blocker, but an annoyance for development. I'm developing a plugin which forks a process and runs the main of a jar (let's call it jupiter.jar). This jar is a maven dependency, and has other jars it depends on. When packaged as an .hpi, all the jars are in the same folder, so when I fork the process, I can just add the folder which holds jupiter.jar to the classpath of the fork. However, when I run it in maven, jupiter.jar is in my .m2 repository, and all the jars are in separate folders (jupiter is in io/developer/.../jupiter.jar, its dependency is in org/apache/.../commons-math.jar).

When I do a "mvn hpi:run" it uses the maven repo instead of holding all the jars in one place. So, the fork doesn't work. This makes development slow; I have to package the .hpi, install it, and then test it on a server.

Are there any workarounds to this problem? Anybody run into the same issue? Is there a way to do some symbolic link trick or something? Is the jupiter.jar in two locations, but the classloader only picks up the more inconvenient of the two? :p
 
-- Larry Bordowitz

Jesse Glick

unread,
Aug 28, 2015, 2:46:22 PM8/28/15
to Jenkins Dev
On Fri, Aug 28, 2015 at 1:22 PM, 'Laurence Bordowitz' via Jenkins
Developers <jenkin...@googlegroups.com> wrote:
> Are there any workarounds to this problem?

Try `Which.jarFile` on a representative class from each (transitive) dependency.
Reply all
Reply to author
Forward
0 new messages