svn commit: r421702 - in /maven/plugins/trunk/maven-jar-plugin/src/site: apt/examples/executable-jar.apt apt/index.apt site.xml

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r421702 - in /maven/plugins/trunk/maven-jar-plugin/src/site: apt/examples/executable-jar.apt apt/index.apt site.xml

Dennis Lundberg-2
Author: dennisl
Date: Thu Jul 13 13:21:34 2006
New Revision: 421702

URL: http://svn.apache.org/viewvc?rev=421702&view=rev
Log:
Add an example about executable jars, as suggested by Barrie Treloar.

Added:
    maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/executable-jar.apt
Modified:
    maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt
    maven/plugins/trunk/maven-jar-plugin/src/site/site.xml

Added: maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/executable-jar.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/executable-jar.apt?rev=421702&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/executable-jar.apt (added)
+++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/executable-jar.apt Thu Jul 13 13:21:34 2006
@@ -0,0 +1,43 @@
+ ------
+ Creating an executable jar file
+ ------
+ Dennis Lundberg
+ ------
+ 13 July 2006
+ ------
+
+Creating an executable jar file
+
+  If you want to create an executable jar file, you need to configure the jar
+  plugin accordingly. You need to tell the plugin which main class to use. This
+  is done with the <<<\<mainClass\>>>> configuration element. The plugin can
+  also add the classpath of your project to the manifest. This is done with the
+  <<<\<addClasspath\>>>> configuration element.
+
+  Here is a sample <<<pom.xml>>> configured to add the classpath and use the
+  class <<<fully.qualified.MainClass>>> as the main class:
+
++-----------------+
+<project>
+  ...
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        ...
+        <configuration>
+          <archive>
+            <manifest>
+              <mainClass>fully.qualified.MainClass</mainClass>
+              <addClasspath>true</addClasspath>
+            </manifest>
+          </archive>
+        </configuration>
+        ...
+      </plugin>
+    </plugins>
+  </build>
+  ...
+</project>
++-----------------+

Modified: maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt?rev=421702&r1=421701&r2=421702&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt Thu Jul 13 13:21:34 2006
@@ -25,15 +25,17 @@
 
 * Usage
 
-  Instructions on how to use the Maven 2 Jar Plugin can be found {{{usage.html}here}}.
+  Instructions on how to use the Jar Plugin can be found {{{usage.html}here}}.
 
   You might also want to consult the {{{http://maven.apache.org/guides/mini/guide-manifest.html}Guide
   to Working with Manifests}}.
 
 * Examples
 
-  To provide you with better understanding of some usages of the Maven 2 Jar Plugin,
+  To provide you with better understanding of some usages of the Jar Plugin,
   you can take a look at the following examples:
+
+  * {{{examples/executable-jar.html}Creating an executable jar file}}
 
   * {{{examples/manifest-customization.html}Manifest customization}}
 

Modified: maven/plugins/trunk/maven-jar-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/site.xml?rev=421702&r1=421701&r2=421702&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/site/site.xml (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/site/site.xml Thu Jul 13 13:21:34 2006
@@ -40,6 +40,7 @@
     </menu>
 
     <menu name="Examples">
+      <item name="Creating an executable jar file" href="examples/executable-jar.html"/>
       <item name="Manifest customization" href="examples/manifest-customization.html"/>
       <item name="Using your own manifest file" href="examples/manifest-file.html"/>
     </menu>