------ Usage ------ Jerome Lacoste Dennis Lundberg ------ 12 July 2006 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Usage Some brief examples on how to use this plugin. If you want to use advanced configurations you should have a look at the documentation for {{{http://maven.apache.org/shared/maven-archiver/}Maven Archiver}}. * 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. You can execute it using the command below: +-----------------+ mvn package +-----------------+ In your project's <<>> directory you'll able to see the generated jar file. * How to sign a jar file If you need to sign your jar, you just need to configure the sign goal appropriately in your <<>>, for the signing to occur automatically during the package phase. Note that you can automatically verify a jar after signing it. +-----------------+ ... jar ... ... org.apache.maven.plugins maven-jar-plugin ${project.version} sign /path/to/your/keystore youralias yourstorepassword \${project.build.directory}/signed/\${project.build.finalName}.jar true ... ... +-----------------+ If you do not specify the <<<\>>> 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 sign a jar file specifying parameters on the command line +-----------------+ mvn jar:sign -Dkeystore=/path/to/your/keystore -Dstorepass=yourstorepassword -Dalias=youralias +-----------------+ * 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 +-----------------+ * How to include/exclude content from jar artifact Specify a list of fileset patterns to be included or excluded by adding <<<\>>>/<<<\>>> or <<<\>>>/<<<\>>> in your <<>>. +-----------------+ ... ... org.apache.maven.plugins maven-jar-plugin ${project.version} **/service/* ... ... +-----------------+ Note that the patterns need to be relative to the path specified for the plugin's <<>> parameter. * How to create an additional attached jar artifact from the project Specify a list of fileset patterns to be included or excluded by adding <<<\>>>/<<<\>>> or <<<\>>>/<<<\>>> and add a <<>> in your <<>>. <> the jar-plugin must be defined in a new execution, otherwise it will replace the default use of the jar-plugin instead of adding a second artifact. The <<>> is also required to create more than one artifact. +-----------------+ ... ... org.apache.maven.plugins maven-jar-plugin ${project.version} package jar client **/service/* ... ... +-----------------+ For full documentation, click {{{plugin-info.html}here}}.