mx:OneJar

mx:OneJar is a fork of the OneJar ANT task by P. Simon Tuffs. It has been enhanced with Moxie integration.

Synopsis

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

Attributes

AttributeDescriptionRequired

Nested Elements

Example

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.

<mx:onejar />

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>