<?xml version="1.0"?>
<document>

  <properties>
    <title>Maven UberJar Plug-in</title>
    <author email="pete-apache-dev@kazmier.com">Pete Kazmier</author>
  </properties>

  <body>
    <section name="Maven UberJar Plug-in">
      <p>
        UberJar packages your project as well as its dependencies into a
        single JAR file.  In addition, bootstrap code is added to the
        archive that enables a main class to be invoked by simply
        typing: <code>java -jar uber.jar</code>.  This enables you to
        easily package up a command line utility into a single JAR
        without worrying about the distribution of your dependencies or
        shell scripts to invoke your main class.  UberJar takes care of
        this for you.
      </p>
      <p>
        UberJar utilizes the <a href="http://classworlds.codehaus.org">
        Classworlds </a> package for the bootstrap code that loads your
        dependencies and executes your <tt>main</tt> method.  It also
        enables your dependent JARs to be inserted into the classpath,
        and best of all, the JARs are located with the UberJar.  JARs
        within JARs are supported by the Classworlds class loaders.
        However, you do not need to know anything about Classworlds to
        build your UberJar.  For those that want more information, see
        the <a href="http://classworlds.codehaus.org/uberjar.html">
        Classworlds uberjar page </a>.
      </p>
      <p>
        To create the UberJar, be sure to define the
        <tt>maven.uberjar.main</tt> property in your project's
        properties file.  Alternatively, if you already have a custom <a
        href="http://classworlds.codehaus.org">Classworlds</a>
        configuration file, specify the
        <tt>maven.uberjar.classworlds.conf</tt> property instead.  To
        create the UberJar, type:
      </p>
      <source>
        maven uberjar
      </source>
      <p>
        Upon success, the UberJar will be located in your target directory
        with a <tt>-uber</tt> appended for identification.  To invoke
        your application, type:
      </p>
      <source>
        java -jar your_uber_jar_here.jar
      </source>
    </section>
  </body>
</document>
