Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp...
by jebblue on Monday October 07, 2013 @10:02AM
(#6508255)
Agreed, this is how I do my Java standalones. Eclipse makes this easy with Export | Runnable Jar providing several options for how to package the build.
Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp...
by danieldk on Monday October 07, 2013 @10:08AM
(#6508300)
The Maven assembly plugin can also do this with the 'jar-with-dependencies' descriptor.
Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp...
by gresrun on Monday October 07, 2013 @11:09AM
(#6508705)
I personally use the maven-shade-plugin for this because it has built-in support for handling special resource files like licenses, service definitions, and manifest entries.
Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp...
by agibsonccc on Monday October 07, 2013 @11:27AM
(#6508828)
The maven shade plugin can be dangerous if you hit the zip file limit of 65535 entries. Watch your filters.
Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp...
by yaeger on Tuesday October 08, 2013 @04:23AM
(#6513613)
I wonder how such a setup would play out in regards to Open Source usage.
Say you create a big jar with all dependencies in there in several layers of "lib" folders.
Licenses like LGPL say you have to keep the LGPL archive accessible to the user and grant permission for them to alter/update them.
Would a nested hierarchy of lib folders inside your jar be viewed as hindrance? Certainly you didn't "hide" the LGPL'd components in order for the user to not alter them but I think it could be viewed as "security through obscurity". If I don't immediately see a component, how do I know its there? I guess this could be solved by a readme that lists in detail what open source components are used and where in the hierarchy they can be found.
Re:Why Java Now Rocks More Than Ever: Part 1 – The Java Comp...
by jonstewart on Monday October 07, 2013 @12:09PM
(#6509172)
Yeah, I've used jarjar before for this.
It is possible to roll a 'fat' JAR with all your dependencies baked-in, which is as close to static linking as it gets in Java-land. I prefer this for stand-alone applications as it makes deployment a cinch at the expense of the size of the build artifact.