Login  Register

Re: Making an executable JAR with Maven

Posted by jmaasing on Mar 13, 2014; 2:34pm
URL: https://forum.jogamp.org/Making-an-executable-JAR-with-Maven-tp4031871p4031885.html

I never liked the fat-JAR approach (sooo many problems) so I distribute a ZIP-file. But I guess that the same tricks I use can be used to make a fat jar without flattening.

This is one of my assembly.xml : https://code.google.com/p/svansprogram/source/browse/application/svansprogram-assembly/assembly.xml
This takes all project dependecies and put in a "lib" directory (the first dependecySet), I set unpack=false because i don't want the JARs unpacked. Then I take the executable JAR and put in the directory above the lib-directory.

However, what you could probably do is use several dependecySets, but with unpack=true, that takes the dependecies one-by-one and unpacks them in respective directories with JOGL-compatible names.
The assembly plugin should then finally ZIP all of it into one file, I use ZIP but I guess it could use JAR packaging also - haven't tried that.

So I guess dependecySets is the solution, that's why there never was a file mapper.

BTW, Ant+Ivy is still the best build system for java IMHO