Author: dennisl Date: Tue Jul 11 15:48:44 2006 New Revision: 421019 URL: http://svn.apache.org/viewvc?rev=421019&view=rev Log: [MJAR-46] Document <manifestFile> element in configuration [MJAR-47] maven-jar-plugin documentation should point to additional documentation, such as manifest guide [MJAR-48] Review plugin documentation - Add FAQ - Add links to the Javadocs for MavenArchiveConfiguration - Review all the parameters to ensure they have good docs
Added: maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/ maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-customization.apt maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-file.apt maven/plugins/trunk/maven-jar-plugin/src/site/fml/ maven/plugins/trunk/maven-jar-plugin/src/site/fml/faq.fml Modified: maven/plugins/trunk/maven-jar-plugin/pom.xml maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignMojo.java maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignVerifyMojo.java maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt maven/plugins/trunk/maven-jar-plugin/src/site/site.xml Modified: maven/plugins/trunk/maven-jar-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/pom.xml?rev=421019&r1=421018&r2=421019&view=diff ============================================================================== --- maven/plugins/trunk/maven-jar-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-jar-plugin/pom.xml Tue Jul 11 15:48:44 2006 @@ -54,11 +54,4 @@ </dependency> </dependencies> - <reporting> - <plugins> - <plugin> - <artifactId>maven-changelog-plugin</artifactId> - </plugin> - </plugins> - </reporting> </project> Modified: maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java?rev=421019&r1=421018&r2=421019&view=diff ============================================================================== --- maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java (original) +++ maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java Tue Jul 11 15:48:44 2006 @@ -1,7 +1,7 @@ package org.apache.maven.plugin.jar; /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 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. @@ -74,7 +74,9 @@ private MavenProject project; /** - * The maven archiver to use. + * The maven archive configuration to use. + * + * See <a href="http://maven.apache.org/ref/current/maven-archiver/apidocs/org/apache/maven/archiver/MavenArchiveConfiguration.html">the Javadocs for MavenArchiveConfiguration</a>. * * @parameter */ Modified: maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignMojo.java?rev=421019&r1=421018&r2=421019&view=diff ============================================================================== --- maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignMojo.java (original) +++ maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignMojo.java Tue Jul 11 15:48:44 2006 @@ -1,7 +1,7 @@ package org.apache.maven.plugin.jar; /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 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. @@ -58,6 +58,8 @@ private boolean skip; /** + * The working directory in which the jarsigner executable will be run. + * * @parameter expression="${workingdir}" default-value="${basedir}" * @required */ Modified: maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignVerifyMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignVerifyMojo.java?rev=421019&r1=421018&r2=421019&view=diff ============================================================================== --- maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignVerifyMojo.java (original) +++ maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarSignVerifyMojo.java Tue Jul 11 15:48:44 2006 @@ -1,7 +1,7 @@ package org.apache.maven.plugin.jar; /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 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. @@ -51,6 +51,8 @@ extends AbstractMojo { /** + * The working directory in which the jarsigner executable will be run. + * * @parameter expression="${workingdir}" default-value="${basedir}" * @required */ @@ -81,7 +83,7 @@ private File jarPath; /** - * Check certificates. Requires [EMAIL PROTECTED] #setVerbose()}. + * Check certificates. Requires [EMAIL PROTECTED] #setVerbose(boolean)}. * See <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jarsigner.html#Options">options</a>. * * @parameter expression="${checkcerts}" default-value="false" Added: maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-customization.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-customization.apt?rev=421019&view=auto ============================================================================== --- maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-customization.apt (added) +++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-customization.apt Tue Jul 11 15:48:44 2006 @@ -0,0 +1,58 @@ + ------ + Manifest customization + ------ + Dennis Lundberg + ------ + 12 July 2006 + ------ + +Manifest customization + + By default a manifest will contain something like the following: + ++-----------------+ + Manifest-Version: 1.0 + Built-By: ${user.name} + Created-By: Apache Maven + Build-Jdk: ${java.version} + Extension-Name: ${project.artifactId} + Specification-Vendor: ${project.organization.name} + Implementation-Vendor: ${project.organization.name} + Implementation-Title: ${project.description} + Implementation-Version: ${project.version} ++-----------------+ + + Configuration can be done using the <<<archive>>> element. Below you will + find some of the configuration options that are available. For more info see + the + {{{http://maven.apache.org/ref/current/maven-archiver/apidocs/org/apache/maven/archiver/MavenArchiveConfiguration.html}MavenArchiveConfiguration Javadocs}}. + ++-----------------+ +<project> + ... + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + ... + <configuration> + <archive> + <index>true</index> + <manifest> + <addClasspath>true</addClasspath> + </manifest> + <manifestEntries> + <mode>development</mode> + <url>${pom.url}</url> + <key>value</key> + </manifestEntries> + </archive> + </configuration> + ... + </plugin> + </plugins> + </build> + ... +</project> ++-----------------+ Added: maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-file.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-file.apt?rev=421019&view=auto ============================================================================== --- maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-file.apt (added) +++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/examples/manifest-file.apt Tue Jul 11 15:48:44 2006 @@ -0,0 +1,36 @@ + ------ + Using your own manifest file + ------ + Dennis Lundberg + ------ + 12 July 2006 + ------ + +Using your own manifest file + + It is sometimes useful to use your own hand crafted manifest file. You can + do this with this plugin. To use the manifest file + <<<src/main/resources/META-INF/MANIFEST.MF>>> put this configuration in your + <<<pom.xml>>>: + ++-----------------+ +<project> + ... + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + ... + <configuration> + <archive> + <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile> + </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=421019&r1=421018&r2=421019&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 Tue Jul 11 15:48:44 2006 @@ -1,13 +1,40 @@ ------ - Maven 2 JAR Plugin + Introduction ------ + Dennis Lundberg + ------ + 12 July 2006 + ------ + + +Maven 2 Jar Plugin + + This plugin provides the capability to build and sign jars. + +* Goals Overview + + * {{{jar-mojo.html}jar:jar}} create a jar file for your project sources. + + * {{{test-jar-mojo.html}test-jar:jar}} create a jar file for your project test classes. + + * {{{sign-mojo.html}jar:sign}} sign a jar file. + + * {{{sign-verify-mojo.html}jar:sign-verify}} verify a signed jar file. + + [] + +* Usage + + Instructions on how to use the Maven 2 Jar Plugin can be found {{{usage.html}here}}. -Maven 2 JAR Plugin + You might also want to consult the {{{http://maven.apache.org/guides/mini/guide-manifest.html}Guide + to Working with Manifests}}. - This plugin provides the capability to manipulate jars. Currently it can create jars for your project sources or tests classes. To achieve this use -"jar:jar" or "jar:test-jar". +* Examples - It also provides the capability to sign and verify a signed jar file with the goals "jar:sign" and "jar:sign-verify". + To provide you with better understanding of some usages of the Maven 2 Jar Plugin, + you can take a look at the following examples: - To learn how to use the plugin, click {{{usage.html}here}}. + * {{{examples/manifest-customization.html}Manifest customization}} + * {{{examples/manifest-file.html}Using your own manifest file}} Modified: maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt?rev=421019&r1=421018&r2=421019&view=diff ============================================================================== --- maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt (original) +++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt Tue Jul 11 15:48:44 2006 @@ -1,74 +1,47 @@ ------ - Maven 2 JAR Plugin + Usage + ------ + Jerome Lacoste + Dennis Lundberg + ------ + 12 July 2006 ------ -How to use +Usage - Brief examples on how to use the jar:jar, jar:sign and jar:sign-verify goals. + Some brief examples on how to use this plugin. If you want to use advanced + configurations you should have a look at + {{{http://maven.apache.org/ref/current/maven-archiver/apidocs/org/apache/maven/archiver/MavenArchiveConfiguration.html}the Javadocs for MavenArchiveConfiguration}}. -* How to use jar:jar +* How to build a jar file If the packaging of your project is set to 'jar', this plugin is executed whenever it passes the "package" phase. Have it executed using the command below from your project: -------------------- ++-----------------+ mvn package -------------------- - - From your project's target directory you'll able to see the generated jar file. - ++-----------------+ -* Manifest customization + In your project's target directory you'll able to see the generated jar file. - By default a manifest will contain something like the following -------------------- - Manifest-Version: 1.0 - Built-By: ${user.name} - Created-By: Apache Maven - Build-Jdk: ${java.version} - Extension-Name: ${project.artifactId} - Specification-Vendor: ${project.organization.name} - Implementation-Vendor: ${project.organization.name} - Implementation-Title: ${project.description} - Implementation-Version: ${project.version} -------------------- - - Configuration can be done using the <<<archive>>> element. See the - {{{http://maven.apache.org/ref/current/maven-archiver/apidocs/org/apache/maven/archiver/MavenArchiveConfiguration.html}maven archive reference}}. - -------------------- - <configuration> - <archive> - <index>true</index> - <manifest> - <addClasspath>true</addClasspath> - </manifest> - <manifestEntries> - <mode>development</mode> - <url>${pom.url}</url> - <key>value</key> - </manifestEntries> - </archive> - </configuration> -------------------- - - -* How to configure jar:sign using pom.xml +* How to sign a jar file If you need to sign a jar, when using the 'jar' packaging, you just need to configure - the sign goal appropriately for the signing to occur automatically during the package phase. + the sign goal appropriately in your <<<pom.xml>>> for the signing to occur + automatically during the package phase. Note that you can automatically verify a jar after signing it. -------------------- ++-----------------+ <project> ... <packaging>jar</packaging> ... <build> <plugins> + ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> @@ -83,34 +56,36 @@ <keystore>/path/to/your/keystore</keystore> <alias>youralias</alias> <storepass>yourstorepassword</storepass> - <!--signedjar>${project.build.directory}/signed/${project.build.finalName}.jar</signedjar--> + <signedjar>${project.build.directory}/signed/${project.build.finalName}.jar</signedjar> <verify>true</verify> </configuration> </plugin> + ... </plugins> </build> + ... </project> -------------------- ++-----------------+ - If you do not specify the signedjar file, your jar will be signed in-place. - If you do specify it, the program will attempt to create the resulting containing directory. + If you do not specify the \<signedjar\> file, your jar will be signed in-place. + If you do specify it, the plugin will attempt to create the resulting containing directory. -* How to use jar:sign specifying parameters on the command line +* How to sign a jar file specifying parameters on the command line -------------------- ++-----------------+ mvn jar:sign -Dkeystore=/path/to/your/keystore -Dstorepass=yourstorepassword -Dalias=youralias -------------------- ++-----------------+ -* How to use jar:sign-verify specifying parameters on the command line +* How to verify a signed jar file specifying parameters on the command line -------------------- ++-----------------+ mvn jar:sign-verify [-Djarpath=/path/to/your/signedjar] [-Dverbose=true [-Dcheckcerts=true] ] -------------------- ++-----------------+ * How to disable jar signing -------------------- ++-----------------+ mvn ... -Dmaven.jar.skip.sign=true -------------------- ++-----------------+ For full documentation, click {{{plugin-info.html}here}}. Added: maven/plugins/trunk/maven-jar-plugin/src/site/fml/faq.fml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/fml/faq.fml?rev=421019&view=auto ============================================================================== --- maven/plugins/trunk/maven-jar-plugin/src/site/fml/faq.fml (added) +++ maven/plugins/trunk/maven-jar-plugin/src/site/fml/faq.fml Tue Jul 11 15:48:44 2006 @@ -0,0 +1,16 @@ +<?xml version="1.0"?> +<faqs id="FAQ" title="Frequently Asked Questions"> + <part id="General"> + <faq id="question1"> + <question>Why is there no documentation for the archive parameter?</question> + <answer> + <p> + The archive parameter is a class that resides outside of this plugin, + in the Maven Archiver component to be exact. The best we can do at this + time is to provide you with a link to the documentation for the + <a href="http://maven.apache.org/ref/current/maven-archiver/apidocs/org/apache/maven/archiver/MavenArchiveConfiguration.html">MavenArchiveConfiguration class</a>. + </p> + </answer> + </faq> + </part> +</faqs> \ No newline at end of file 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=421019&r1=421018&r2=421019&view=diff ============================================================================== --- maven/plugins/trunk/maven-jar-plugin/src/site/site.xml (original) +++ maven/plugins/trunk/maven-jar-plugin/src/site/site.xml Tue Jul 11 15:48:44 2006 @@ -1,6 +1,26 @@ -<project name="Maven JAR plugin"> +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- +/* + * Copyright 2005-2006 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. + */ +--> + +<project name="Maven Jar plugin"> <bannerLeft> - <name>Maven JAR plugin</name> + <name>Maven Jar plugin</name> <src>http://maven.apache.org/images/apache-maven-project.png</src> <href>http://maven.apache.org/</href> </bannerLeft> @@ -13,9 +33,17 @@ </links> <menu name="Overview"> - <item name="Overview" href="index.html"/> + <item name="Introduction" href="index.html"/> + <item name="Goals" href="plugin-info.html"/> <item name="Usage" href="usage.html"/> + <item name="FAQ" href="faq.html"/> </menu> + + <menu name="Examples"> + <item name="Manifest customization" href="examples/manifest-customization.html"/> + <item name="Using your own manifest file" href="examples/manifest-file.html"/> + </menu> + ${reports} </body> </project>