git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114795 13f79535-47bb-0310-9956-ffa450edef68
74 lines
2.8 KiB
XML
74 lines
2.8 KiB
XML
<?xml version="1.0"?>
|
|
<!--
|
|
/*
|
|
* Copyright 2001-2004 The Apache Software Foundation.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
-->
|
|
|
|
<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>
|