mx:OneJar is a fork of the OneJar ANT task by P. Simon Tuffs. It has been enhanced with Moxie integration.
One-JAR lets you package a Java application together with its dependency Jars into a single executable Jar file.
One-JAR provides custom classloader that knows how to load classes and resources from a jars inside an archive, instead of from jars in the filesystem. It discovers dependency jar files based on the internal structure of the archive, there is no custom code required to do this. Your application can be run using java -jar my-app.jar
This example will build a One-JAR jar file from your compiled sources and compile dependencies. The mainclass defind in build.moxie will be the jar's main-class.
This example will build a One-JAR jar file from your compiled sources and compile dependencies tagged as manager. The mainclass is manually specified.
<mx:onejar> <mainclass name="com.gitblit.client.Manager" /> <dependencies tag="manager" /> </mx:onejar>