Modified: websites/production/maven/content/shared-archives/maven-archiver-LATEST/examples/classpath.html ============================================================================== --- websites/production/maven/content/shared-archives/maven-archiver-LATEST/examples/classpath.html (original) +++ websites/production/maven/content/shared-archives/maven-archiver-LATEST/examples/classpath.html Sun Oct 26 20:16:43 2014 @@ -1,372 +1,489 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<!-- Generated by Apache Maven Doxia at Feb 1, 2012 --> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>Set Up The Classpath</title> - <style type="text/css" media="all"> - @import url("../css/maven-base.css"); - @import url("../css/maven-theme.css"); - @import url("../css/site.css"); - </style> - <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" /> - <meta name="author" content="Dennis Lundberg" /> - <meta name="Date-Creation-yyyymmdd" content="20080101" /> - <meta name="Date-Revision-yyyymmdd" content="20120201" /> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - -<script type="text/javascript" src="http://www.google-analytics.com/urchin.js"></script> - -<script type="text/javascript">_uacct = "UA-140879-1"; - urchinTracker();</script> - </head> - <body class="composite"> - <div id="banner"> - <a href="../../../" id="bannerLeft"> - <img src="../../../images/apache-maven-project-2.png" alt="" /> - </a> - <span id="bannerRight"> - <img src="../../../images/maven-logo-2.gif" alt="" /> - </span> - <div class="clear"> - <hr/> - </div> - </div> - <div id="breadcrumbs"> - - <div class="xleft"> - <a href="http://www.apache.org/" class="externalLink">Apache</a> - > - <a href="../../../index.html">Maven</a> - > - <a href="../../index.html">Shared Components</a> - > - <a href="../">Maven Archiver</a> - > - Set Up The Classpath - </div> - <div class="xright"> - Last Published: 2012-02-01 - | Version: 2.5 - </div> - <div class="clear"> - <hr/> - </div> - </div> - <div id="leftColumn"> - <div id="navcolumn"> - - <h5>Overview</h5> - <ul> - <li class="none"> - <a href="../index.html">Introduction</a> - </li> - <li class="none"> - <a href="../apidocs/index.html">JavaDocs</a> - </li> - <li class="none"> - <a href="../xref/index.html">Source Xref</a> - </li> - </ul> - <h5>Examples</h5> - <ul> - <li class="none"> - <a href="../examples/manifest.html">Manifest</a> - </li> - <li class="none"> - <a href="../examples/manifestEntries.html">Manifest Entries</a> - </li> - <li class="none"> - <a href="../examples/manifestSections.html">Manifest Sections</a> - </li> - <li class="none"> - <strong>Set Up The Classpath</strong> - </li> - <li class="none"> - <a href="../examples/manifestFile.html">Use Your Own Manifest File</a> - </li> - </ul> - <h5>Project Documentation</h5> - <ul> - <li class="collapsed"> - <a href="../project-info.html">Project Information</a> - </li> - <li class="collapsed"> - <a href="../project-reports.html">Project Reports</a> - </li> - </ul> - <h5>Maven Projects</h5> - <ul> - <li class="none"> - <a href="../../../ant-tasks/index.html">Ant Tasks</a> - </li> - <li class="none"> - <a href="../../../archetype/index.html">Archetype</a> - </li> - <li class="none"> - <a href="../../../doxia/index.html">Doxia</a> - </li> - <li class="none"> - <a href="../../../jxr/index.html">JXR</a> - </li> - <li class="none"> - <a href="../../../maven-1.x/index.html">Maven 1.x</a> - </li> - <li class="none"> - <a href="../../../index.html">Maven 2 & 3</a> - </li> - <li class="none"> - <a href="../../../plugins/index.html">Plugins</a> - </li> - <li class="none"> - <a href="../../../scm/index.html">SCM</a> - </li> - <li class="none"> - <a href="../../index.html">Shared Components</a> - </li> - <li class="none"> - <a href="../../../surefire/index.html">Surefire</a> - </li> - <li class="none"> - <a href="../../../wagon/index.html">Wagon</a> - </li> - </ul> - <h5>ASF</h5> - <ul> - <li class="none"> - <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink">How Apache Works</a> - </li> - <li class="none"> - <a href="http://www.apache.org/foundation/" class="externalLink">Foundation</a> - </li> - <li class="none"> - <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink">Sponsoring Apache</a> - </li> - <li class="none"> - <a href="http://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a> - </li> - </ul> - <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> - <img alt="Built by Maven" src="../images/logos/maven-feather.png"/> - </a> - - </div> - </div> - <div id="bodyColumn"> - <div id="contentBox"> - <!-- 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. --><div class="section"><h2>Set Up The Classpath<a name="Set_Up_The_Classpath"></a></h2><div class="section"><h 3><a name="Contents">Contents</a></h3><ul><li><a href="#aAdd">Add A Class-Path Entry To The Manifest</a></li><li><a href="#aMake">Make The Jar Executable</a></li><li><a href="#aPrefix">Altering The Classpath: Defining a Classpath Directory Prefix</a></li><li><a href="#aRepository">Altering The Classpath: Using a Maven Repository-Style Classpath</a></li><li><a href="#aCustom">Altering The Classpath: Using a Custom Classpath Format</a></li><li><a href="#aSnapshot">Handling Snapshot Versions</a></li></ul></div><div class="section"><h3><a name="Add">Add</a> A Class-Path Entry To The Manifest<a name="Add_A_Class-Path_Entry_To_The_Manifest"></a></h3><p>[<a href="#aContents">Top</a>]</p><p>Maven Archiver can add the classpath of your project to the manifest. This is done with the <tt><addClasspath></tt> configuration element.</p><div class="source"><pre><project> - ... - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - ... - <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - </manifest> - </archive> - </configuration> - ... - </plugin> - </plugins> - </build> - ... - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.1</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>1.1</version> - </dependency> - </dependencies> - ... -</project></pre></div><p>The manifest produced using the above configuration would look like this:</p><div class="source"><pre>Manifest-Version: 1.0 -Archiver-Version: Plexus Archiver -Created-By: Apache Maven -Built-By: ${user.name} -Build-Jdk: ${java.version} -Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar</pre></div></div><div class="section"><h3><a name="Make">Make</a> The Jar Executable<a name="Make_The_Jar_Executable"></a></h3><p>[<a href="#aContents">Top</a>]</p><p>If you want to create an executable jar file, you need to configure Maven Archiver accordingly. You need to tell it which main class to use. This is done with the <tt><mainClass></tt> configuration element. Here is a sample <tt>pom.xml</tt> configured to add the classpath and use the class <tt>fully.qualified.MainClass</tt> as the main class:</p><div class="source"><pre><project> - ... - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - ... - <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <mainClass>fully.qualified.MainClass</mainClass> - </manifest> - </archive> - </configuration> - ... - </plugin> - </plugins> - </build> - ... - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.1</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>1.1</version> - </dependency> - </dependencies> - ... -</project></pre></div><p>The manifest produced using the above configuration would look like this:</p><div class="source"><pre>Manifest-Version: 1.0 -Archiver-Version: Plexus Archiver -Created-By: Apache Maven -Built-By: ${user.name} -Build-Jdk: ${java.version} -Main-Class: fully.qualified.MainClass -Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar</pre></div></div><div class="section"><h3>Altering The Classpath: Defining a Classpath Directory <a name="Prefix">Prefix</a><a name="Altering_The_Classpath:_Defining_a_Classpath_Directory_Prefix"></a></h3><p>[<a href="#aContents">Top</a>]</p><p>Sometimes it is useful to be able to alter the classpath, for example when <a class="externalLink" href="http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html">creating skinny war-files</a>. This can be achieved with the <tt><classpathPrefix></tt> configuration element.</p><div class="source"><pre><project> - ... - <build> - <plugins> - <plugin> - <artifactId>maven-war-plugin</artifactId> - <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <classpathPrefix>lib/</classpathPrefix> - </manifest> - </archive> - </configuration> - </plugin> - </plugins> - </build> - ... - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.1</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>1.1</version> - </dependency> - </dependencies> - ... -</project></pre></div><p>The manifest classpath produced using the above configuration would look like this:</p><div class="source"><pre>Class-Path: lib/plexus-utils-1.1.jar lib/commons-lang-2.1.jar</pre></div></div><div class="section"><h3>Altering The Classpath: Using a Maven <a name="Repository">Repository</a>-Style Classpath<a name="Altering_The_Classpath:_Using_a_Maven_Repository-Style_Classpath"></a></h3><p>[<a href="#aContents">Top</a>]</p><p><i>(Since: 2.3, see below)</i></p><p>Occasionally, you may want to include a Maven repository-style directory structure in your archive. If you wish to reference the dependency archives within those directories in your manifest classpath, try using the <tt><classpathLayoutType></tt> element with a value of <tt>'repository'</tt>, like this:</p><div class="source"><pre><project> - ... - <build> - <plugins> - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <version>2.3</version> - <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <classpathPrefix>lib/</classpathPrefix> - <classpathLayoutType>repository</classpathLayoutType> - - <!-- NOTE: Deprecated in version 2.4. Use 'classpathLayoutType' instead. - <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout> - --> - </manifest> - </archive> - </configuration> - </plugin> - </plugins> - </build> - ... - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.1</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>1.1</version> - </dependency> - </dependencies> - ... -</project></pre></div><p><b>Note:</b> In version 2.3, this feature was available by setting the <tt><classpathMavenRepositoryLayout></tt> element to the value <tt>true</tt>. This configuration option has been *deprecated* in version 2.4, in favor of the more general <tt><classpathLayoutType></tt> element, where a value of <tt>'repository'</tt> will render the same behavior.</p><p>The manifest classpath produced using the above configuration would look like this:</p><div class="source"><pre>Class-Path: lib/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar lib/commons-lang/commons-lang/2.1/commons-lang-2.1.jar</pre></div></div><div class="section"><h3>Altering The Classpath: Using a <a name="Custom">Custom</a> Classpath Format<a name="Altering_The_Classpath:_Using_a_Custom_Classpath_Format"></a></h3><p>[<a href="#aContents">Top</a>]</p><p><i>(Since: 2.4)</i></p><p>At times, you may have dependency archives in a custom format within your own archive, one that doesn't conform to any of the above classpath layouts. If you wish to define a custom layout for dependency archives within your archive's manifest classpath, try using the <tt><classpathLayoutType></tt> element with a value of <tt>'custom'</tt>, along with the <tt><customClasspathLayout></tt> element, like this:</p><div class="source"><pre><project> - ... - <build> - <plugins> - <plugin> - <artifactId>maven-war-plugin</artifactId> - <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <classpathLayoutType>custom</classpathLayoutType> - <customClasspathLayout>WEB-INF/lib/$${artifact.groupIdPath}/$${artifact.artifactId}-$${artifact.version}$${dashClassifier?}.$${artifact.extension}</customClasspathLayout> - </manifest> - </archive> - </configuration> - </plugin> - </plugins> - </build> - ... - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.1</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>1.1</version> - </dependency> - </dependencies> - ... -</project></pre></div><p>This classpath layout is a little more involved than the previous examples. To understand how the value of the <tt><customClasspathLayout></tt> configuration is interpreted, it's useful to understand the rules applied when resolving expressions within the value:</p><ol style="list-style-type: decimal"><li>If present, trim off the prefix 'artifact.' from the expression.</li><li>Attempt to resolve the expression as a reference to the Artifact using reflection (eg. <tt>'artifactId'</tt> becomes a reference to the method <tt>'getArtifactId()'</tt>).</li><li>Attempt to resolve the expression as a reference to the ArtifactHandler of the current Artifact, again using reflection (eg. <tt>'extension'</tt> becomes a reference to the method <tt>'getExtension()'</tt>).</li><li>Attempt to resolve the expression as a key in the special-case Properties instance, which contains the following mappings:<ul><li><tt>'dashClassifier'</tt>: If the Artifact has a class ifier, this will be <tt>'-$<a name="artifact.classifier">artifact.classifier</a>'</tt>, otherwise this is an empty string.</li><li><tt>'dashClassifier?'</tt>: This is a synonym of <tt>'dashClassifier'</tt>.</li><li><tt>'groupIdPath'</tt>: This is the equivalent of <tt>'$<a name="artifact.groupId">artifact.groupId</a>'</tt>, with all <tt>'.'</tt> characters replaced by <tt>'/'</tt>.</li></ul></li></ol><p>The manifest classpath produced using the above configuration would look like this:</p><div class="source"><pre>Class-Path: WEB-INF/lib/org/codehaus/plexus/plexus-utils-1.1.jar WEB-INF/lib/commons-lang/commons-lang-2.1.jar</pre></div></div><div class="section"><h3>Handling <a name="Snapshot">Snapshot</a> Versions<a name="Handling_Snapshot_Versions"></a></h3><p>[<a href="#aContents">Top</a>]</p><p><i>(Since 2.4)</i></p><p>Depending on how you construct your archive, you may have the ability to specify whether snapshot dependency archives are included with the version suffix <tt>'-SNAP SHOT'</tt>, or whether the unique timestamp and build-number for that archive is used. For instance, the <a class="externalLink" href="http://maven.apache.org/plugins/maven-assembly-plugin">Assembly Plugin</a> allows you to make this decision in the <tt><outputFileNameMapping></tt> element of its <tt><dependencySet</tt>> descriptor section.</p><div class="section"><h4>Forcing the use of -SNAPSHOT versions when using the simple (default) or repository classpath layout<a name="Forcing_the_use_of_-SNAPSHOT_versions_when_using_the_simple_default_or_repository_classpath_layout"></a></h4><p>To force the use of <tt>'-SNAPSHOT'</tt> version naming, simply disable the <tt><useUniqueVersions></tt> configuration element, like this:</p><div class="source"><pre><useUniqueVersions>false</useUniqueVersions></pre></div></div><div class="section"><h4>Forcing the use of -SNAPSHOT versions with custom layouts<a name="Forcing_the_use_of_-SNAPSHOT_versions_with_custom_layou ts"></a></h4><p>To force the use of <tt>'-SNAPSHOT'</tt> version naming, simply replace <tt>'$<a name="artifact.version">artifact.version</a>'</tt> with <tt>'$<a name="artifact.baseVersion">artifact.baseVersion</a>'</tt> in the custom layout example above, so it looks like this:</p><div class="source"><pre><customClasspathLayout>WEB-INF/lib/${artifact.groupIdPath}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</customClasspathLayout></pre></div><p>The full example configuration would look like this:</p><div class="source"><pre><project> - ... - <build> - <plugins> - <plugin> - <artifactId>maven-war-plugin</artifactId> - <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <classpathLayoutType>custom</classpathLayoutType> - <customClasspathLayout>WEB-INF/lib/${artifact.groupIdPath}/${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}</customClasspathLayout> - </manifest> - </archive> - </configuration> - </plugin> - </plugins> - </build> - ... -</project></pre></div></div></div></div> - </div> - </div> - <div class="clear"> - <hr/> - </div> - <div id="footer"> - <div class="xright"> - © 2002-2012 - The Apache Software Foundation - - - <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>. - Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation. - </div> - <div class="clear"> - <hr/> - </div> - </div> - </body> -</html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- + | Generated by Apache Maven Doxia at 2014-10-26 + | Rendered using Apache Maven Stylus Skin 1.5 +--> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>Apache Maven Archiver - Set Up The Classpath</title> + <style type="text/css" media="all"> + @import url("../css/maven-base.css"); + @import url("../css/maven-theme.css"); + @import url("../css/site.css"); + </style> + <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" /> + <meta name="author" content="Dennis Lundberg" /> + <meta name="Date-Creation-yyyymmdd" content="20080101" /> + <meta name="Date-Revision-yyyymmdd" content="20141026" /> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + +<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> + +<script type="text/javascript">_uacct = "UA-140879-1"; + urchinTracker();</script> + </head> + <body class="composite"> + <div id="banner"> + <a href="../../../" id="bannerLeft"> + <img src="../../../images/apache-maven-project-2.png" alt="" /> + </a> + <span id="bannerRight"> + <img src="../../../images/maven-logo-2.gif" alt="" /> + </span> + <div class="clear"> + <hr/> + </div> + </div> + <div id="breadcrumbs"> + + <div class="xleft"> + <a href="http://www.apache.org/" class="externalLink">Apache</a> + > + <a href="../../../index.html">Maven</a> + > + <a href="../../index.html">Shared Components</a> + > + <a href="../">Apache Maven Archiver</a> + > + Set Up The Classpath + </div> + <div class="xright"> + Last Published: 2014-10-26 + | Version: 2.6 + </div> + <div class="clear"> + <hr/> + </div> + </div> + <div id="leftColumn"> + <div id="navcolumn"> + + <h5>Overview</h5> + <ul> + <li class="none"> + <a href="../index.html">Introduction</a> + </li> + <li class="none"> + <a href="../apidocs/index.html">JavaDocs</a> + </li> + <li class="none"> + <a href="../xref/index.html">Source Xref</a> + </li> + <li class="none"> + <a href="http://www.apache.org/licenses/" class="externalLink">License</a> + </li> + <li class="none"> + <a href="../download.html">Download</a> + </li> + </ul> + <h5>Examples</h5> + <ul> + <li class="none"> + <a href="../examples/manifest.html">Manifest</a> + </li> + <li class="none"> + <a href="../examples/manifestEntries.html">Manifest Entries</a> + </li> + <li class="none"> + <a href="../examples/manifestSections.html">Manifest Sections</a> + </li> + <li class="none"> + <strong>Set Up The Classpath</strong> + </li> + <li class="none"> + <a href="../examples/manifestFile.html">Use Your Own Manifest File</a> + </li> + </ul> + <h5>Project Documentation</h5> + <ul> + <li class="collapsed"> + <a href="../project-info.html">Project Information</a> + </li> + <li class="collapsed"> + <a href="../project-reports.html">Project Reports</a> + </li> + </ul> + <h5>Maven Projects</h5> + <ul> + <li class="none"> + <a href="../../../ant-tasks/index.html">Ant Tasks</a> + </li> + <li class="none"> + <a href="../../../archetype/index.html">Archetype</a> + </li> + <li class="none"> + <a href="../../../doxia/index.html">Doxia</a> + </li> + <li class="none"> + <a href="../../../jxr/index.html">JXR</a> + </li> + <li class="none"> + <a href="../../../maven-1.x/index.html">Maven 1.x</a> + </li> + <li class="none"> + <a href="../../../index.html">Maven 2 & 3</a> + </li> + <li class="none"> + <a href="../../../pom/index.html">Parent POMs</a> + </li> + <li class="none"> + <a href="../../../plugins/index.html">Plugins</a> + </li> + <li class="none"> + <a href="../../../plugin-tools/index.html">Plugin Tools</a> + </li> + <li class="none"> + <a href="../../../scm/index.html">SCM</a> + </li> + <li class="none"> + <a href="../../index.html">Shared Components</a> + </li> + <li class="none"> + <a href="../../../skins/index.html">Skins</a> + </li> + <li class="none"> + <a href="../../../surefire/index.html">Surefire</a> + </li> + <li class="none"> + <a href="../../../wagon/index.html">Wagon</a> + </li> + </ul> + <h5>ASF</h5> + <ul> + <li class="none"> + <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink">How Apache Works</a> + </li> + <li class="none"> + <a href="http://www.apache.org/foundation/" class="externalLink">Foundation</a> + </li> + <li class="none"> + <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink">Sponsoring Apache</a> + </li> + <li class="none"> + <a href="http://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a> + </li> + </ul> + <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> + <img alt="Built by Maven" src="../images/logos/maven-feather.png"/> + </a> + + </div> + </div> + <div id="bodyColumn"> + <div id="contentBox"> + <!-- 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. --><div class="section"> +<h2>Set Up The Classpath<a name="Set_Up_The_Classpath"></a></h2> +<div class="section"> +<h3><a name="Contents">Contents</a></h3> +<ul> +<li><a href="#Add">Add A Class-Path Entry To The Manifest</a></li> +<li><a href="#Make">Make The Jar Executable</a></li> +<li><a href="#Prefix">Altering The Classpath: Defining a Classpath Directory Prefix</a></li> +<li><a href="#Repository">Altering The Classpath: Using a Maven Repository-Style Classpath</a></li> +<li><a href="#Custom">Altering The Classpath: Using a Custom Classpath Format</a></li> +<li><a href="#Snapshot">Handling Snapshot Versions</a></li></ul></div> +<div class="section"> +<h3><a name="Add">Add</a> A Class-Path Entry To The Manifest<a name="Add_A_Class-Path_Entry_To_The_Manifest"></a></h3> +<p>[<a href="#Contents">Top</a>]</p> +<p>Maven Archiver can add the classpath of your project to the manifest. This is done with the <tt><addClasspath></tt> configuration element.</p> +<div class="source"> +<pre><project> + ... + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + ... + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + </manifest> + </archive> + </configuration> + ... + </plugin> + </plugins> + </build> + ... + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.1</version> + </dependency> + </dependencies> + ... +</project> +</pre></div> +<p>The manifest produced using the above configuration would look like this:</p> +<div class="source"> +<pre>Manifest-Version: 1.0 +Archiver-Version: Plexus Archiver +Created-By: Apache Maven ${maven.version} +Built-By: ${user.name} +Build-Jdk: ${java.version} +Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar +</pre></div></div> +<div class="section"> +<h3><a name="Make">Make</a> The Jar Executable<a name="Make_The_Jar_Executable"></a></h3> +<p>[<a href="#Contents">Top</a>]</p> +<p>If you want to create an executable jar file, you need to configure Maven Archiver accordingly. You need to tell it which main class to use. This is done with the <tt><mainClass></tt> configuration element. Here is a sample <tt>pom.xml</tt> configured to add the classpath and use the class <tt>fully.qualified.MainClass</tt> as the main class:</p> +<div class="source"> +<pre><project> + ... + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + ... + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <mainClass>fully.qualified.MainClass</mainClass> + </manifest> + </archive> + </configuration> + ... + </plugin> + </plugins> + </build> + ... + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.1</version> + </dependency> + </dependencies> + ... +</project> +</pre></div> +<p>The manifest produced using the above configuration would look like this:</p> +<div class="source"> +<pre>Manifest-Version: 1.0 +Archiver-Version: Plexus Archiver +Created-By: Apache Maven ${maven.version} +Built-By: ${user.name} +Build-Jdk: ${java.version} +Main-Class: fully.qualified.MainClass +Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar +</pre></div></div> +<div class="section"> +<h3>Altering The Classpath: Defining a Classpath Directory <a name="Prefix">Prefix</a><a name="Altering_The_Classpath:_Defining_a_Classpath_Directory_Prefix"></a></h3> +<p>[<a href="#Contents">Top</a>]</p> +<p>Sometimes it is useful to be able to alter the classpath, for example when <a class="externalLink" href="http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html">creating skinny war-files</a>. This can be achieved with the <tt><classpathPrefix></tt> configuration element.</p> +<div class="source"> +<pre><project> + ... + <build> + <plugins> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <classpathPrefix>lib/</classpathPrefix> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> + ... + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.1</version> + </dependency> + </dependencies> + ... +</project> +</pre></div> +<p>The manifest classpath produced using the above configuration would look like this:</p> +<div class="source"> +<pre>Class-Path: lib/plexus-utils-1.1.jar lib/commons-lang-2.1.jar +</pre></div></div> +<div class="section"> +<h3>Altering The Classpath: Using a Maven <a name="Repository">Repository</a>-Style Classpath<a name="Altering_The_Classpath:_Using_a_Maven_Repository-Style_Classpath"></a></h3> +<p>[<a href="#Contents">Top</a>]</p> +<p><i>(Since: 2.3, see below)</i></p> +<p>Occasionally, you may want to include a Maven repository-style directory structure in your archive. If you wish to reference the dependency archives within those directories in your manifest classpath, try using the <tt><classpathLayoutType></tt> element with a value of <tt>'repository'</tt>, like this:</p> +<div class="source"> +<pre><project> + ... + <build> + <plugins> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <version>2.3</version> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <classpathPrefix>lib/</classpathPrefix> + <classpathLayoutType>repository</classpathLayoutType> + + <!-- NOTE: Deprecated in version 2.4. Use 'classpathLayoutType' instead. + <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout> + --> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> + ... + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.1</version> + </dependency> + </dependencies> + ... +</project> +</pre></div> +<p><b>Note:</b> In version 2.3, this feature was available by setting the <tt><classpathMavenRepositoryLayout></tt> element to the value <tt>true</tt>. This configuration option has been *deprecated* in version 2.4, in favor of the more general <tt><classpathLayoutType></tt> element, where a value of <tt>'repository'</tt> will render the same behavior.</p> +<p>The manifest classpath produced using the above configuration would look like this:</p> +<div class="source"> +<pre>Class-Path: lib/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar lib/commons-lang/commons-lang/2.1/commons-lang-2.1.jar +</pre></div></div> +<div class="section"> +<h3>Altering The Classpath: Using a <a name="Custom">Custom</a> Classpath Format<a name="Altering_The_Classpath:_Using_a_Custom_Classpath_Format"></a></h3> +<p>[<a href="#Contents">Top</a>]</p> +<p><i>(Since: 2.4)</i></p> +<p>At times, you may have dependency archives in a custom format within your own archive, one that doesn't conform to any of the above classpath layouts. If you wish to define a custom layout for dependency archives within your archive's manifest classpath, try using the <tt><classpathLayoutType></tt> element with a value of <tt>'custom'</tt>, along with the <tt><customClasspathLayout></tt> element, like this:</p> +<div class="source"> +<pre><project> + ... + <build> + <plugins> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <classpathLayoutType>custom</classpathLayoutType> + <customClasspathLayout>WEB-INF/lib/$${artifact.groupIdPath}/$${artifact.artifactId}-$${artifact.version}$${dashClassifier?}.$${artifact.extension}</customClasspathLayout> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> + ... + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.1</version> + </dependency> + </dependencies> + ... +</project> +</pre></div> +<p>This classpath layout is a little more involved than the previous examples. To understand how the value of the <tt><customClasspathLayout></tt> configuration is interpreted, it's useful to understand the rules applied when resolving expressions within the value:</p> +<ol style="list-style-type: decimal"> +<li>If present, trim off the prefix 'artifact.' from the expression.</li> +<li>Attempt to resolve the expression as a reference to the Artifact using reflection (eg. <tt>'artifactId'</tt> becomes a reference to the method <tt>'getArtifactId()'</tt>).</li> +<li>Attempt to resolve the expression as a reference to the ArtifactHandler of the current Artifact, again using reflection (eg. <tt>'extension'</tt> becomes a reference to the method <tt>'getExtension()'</tt>).</li> +<li>Attempt to resolve the expression as a key in the special-case Properties instance, which contains the following mappings: +<ul> +<li><tt>'dashClassifier'</tt>: If the Artifact has a classifier, this will be <tt>'-$<a name="artifact.classifier">artifact.classifier</a>'</tt>, otherwise this is an empty string.</li> +<li><tt>'dashClassifier?'</tt>: This is a synonym of <tt>'dashClassifier'</tt>.</li> +<li><tt>'groupIdPath'</tt>: This is the equivalent of <tt>'$<a name="artifact.groupId">artifact.groupId</a>'</tt>, with all <tt>'.'</tt> characters replaced by <tt>'/'</tt>.</li></ul></li></ol> +<p>The manifest classpath produced using the above configuration would look like this:</p> +<div class="source"> +<pre>Class-Path: WEB-INF/lib/org/codehaus/plexus/plexus-utils-1.1.jar WEB-INF/lib/commons-lang/commons-lang-2.1.jar +</pre></div></div> +<div class="section"> +<h3>Handling <a name="Snapshot">Snapshot</a> Versions<a name="Handling_Snapshot_Versions"></a></h3> +<p>[<a href="#Contents">Top</a>]</p> +<p><i>(Since 2.4)</i></p> +<p>Depending on how you construct your archive, you may have the ability to specify whether snapshot dependency archives are included with the version suffix <tt>'-SNAPSHOT'</tt>, or whether the unique timestamp and build-number for that archive is used. For instance, the <a class="externalLink" href="http://maven.apache.org/plugins/maven-assembly-plugin">Assembly Plugin</a> allows you to make this decision in the <tt><outputFileNameMapping></tt> element of its <tt><dependencySet</tt>> descriptor section.</p> +<div class="section"> +<h4>Forcing the use of -SNAPSHOT versions when using the simple (default) or repository classpath layout<a name="Forcing_the_use_of_-SNAPSHOT_versions_when_using_the_simple_default_or_repository_classpath_layout"></a></h4> +<p>To force the use of <tt>'-SNAPSHOT'</tt> version naming, simply disable the <tt><useUniqueVersions></tt> configuration element, like this:</p> +<div class="source"> +<pre><useUniqueVersions>false</useUniqueVersions> +</pre></div></div> +<div class="section"> +<h4>Forcing the use of -SNAPSHOT versions with custom layouts<a name="Forcing_the_use_of_-SNAPSHOT_versions_with_custom_layouts"></a></h4> +<p>To force the use of <tt>'-SNAPSHOT'</tt> version naming, simply replace <tt>'$<a name="artifact.version">artifact.version</a>'</tt> with <tt>'$<a name="artifact.baseVersion">artifact.baseVersion</a>'</tt> in the custom layout example above, so it looks like this:</p> +<div class="source"> +<pre><customClasspathLayout>WEB-INF/lib/${artifact.groupIdPath}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</customClasspathLayout> +</pre></div> +<p>The full example configuration would look like this:</p> +<div class="source"> +<pre><project> + ... + <build> + <plugins> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <classpathLayoutType>custom</classpathLayoutType> + <customClasspathLayout>WEB-INF/lib/${artifact.groupIdPath}/${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}</customClasspathLayout> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> + ... +</project> +</pre></div></div></div></div> + </div> + </div> + <div class="clear"> + <hr/> + </div> + <div id="footer"> + <div class="xright"> + © 2002-2014 + The Apache Software Foundation + + - <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>. + Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation. + </div> + <div class="clear"> + <hr/> + </div> + </div> + </body> +</html> \ No newline at end of file
Modified: websites/production/maven/content/shared-archives/maven-archiver-LATEST/examples/manifest.html ============================================================================== --- websites/production/maven/content/shared-archives/maven-archiver-LATEST/examples/manifest.html (original) +++ websites/production/maven/content/shared-archives/maven-archiver-LATEST/examples/manifest.html Sun Oct 26 20:16:43 2014 @@ -1,212 +1,252 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<!-- Generated by Apache Maven Doxia at Feb 1, 2012 --> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>Manifest</title> - <style type="text/css" media="all"> - @import url("../css/maven-base.css"); - @import url("../css/maven-theme.css"); - @import url("../css/site.css"); - </style> - <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" /> - <meta name="author" content="Dennis Lundberg" /> - <meta name="Date-Creation-yyyymmdd" content="20080101" /> - <meta name="Date-Revision-yyyymmdd" content="20120201" /> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - -<script type="text/javascript" src="http://www.google-analytics.com/urchin.js"></script> - -<script type="text/javascript">_uacct = "UA-140879-1"; - urchinTracker();</script> - </head> - <body class="composite"> - <div id="banner"> - <a href="../../../" id="bannerLeft"> - <img src="../../../images/apache-maven-project-2.png" alt="" /> - </a> - <span id="bannerRight"> - <img src="../../../images/maven-logo-2.gif" alt="" /> - </span> - <div class="clear"> - <hr/> - </div> - </div> - <div id="breadcrumbs"> - - <div class="xleft"> - <a href="http://www.apache.org/" class="externalLink">Apache</a> - > - <a href="../../../index.html">Maven</a> - > - <a href="../../index.html">Shared Components</a> - > - <a href="../">Maven Archiver</a> - > - Manifest - </div> - <div class="xright"> - Last Published: 2012-02-01 - | Version: 2.5 - </div> - <div class="clear"> - <hr/> - </div> - </div> - <div id="leftColumn"> - <div id="navcolumn"> - - <h5>Overview</h5> - <ul> - <li class="none"> - <a href="../index.html">Introduction</a> - </li> - <li class="none"> - <a href="../apidocs/index.html">JavaDocs</a> - </li> - <li class="none"> - <a href="../xref/index.html">Source Xref</a> - </li> - </ul> - <h5>Examples</h5> - <ul> - <li class="none"> - <strong>Manifest</strong> - </li> - <li class="none"> - <a href="../examples/manifestEntries.html">Manifest Entries</a> - </li> - <li class="none"> - <a href="../examples/manifestSections.html">Manifest Sections</a> - </li> - <li class="none"> - <a href="../examples/classpath.html">Set Up The Classpath</a> - </li> - <li class="none"> - <a href="../examples/manifestFile.html">Use Your Own Manifest File</a> - </li> - </ul> - <h5>Project Documentation</h5> - <ul> - <li class="collapsed"> - <a href="../project-info.html">Project Information</a> - </li> - <li class="collapsed"> - <a href="../project-reports.html">Project Reports</a> - </li> - </ul> - <h5>Maven Projects</h5> - <ul> - <li class="none"> - <a href="../../../ant-tasks/index.html">Ant Tasks</a> - </li> - <li class="none"> - <a href="../../../archetype/index.html">Archetype</a> - </li> - <li class="none"> - <a href="../../../doxia/index.html">Doxia</a> - </li> - <li class="none"> - <a href="../../../jxr/index.html">JXR</a> - </li> - <li class="none"> - <a href="../../../maven-1.x/index.html">Maven 1.x</a> - </li> - <li class="none"> - <a href="../../../index.html">Maven 2 & 3</a> - </li> - <li class="none"> - <a href="../../../plugins/index.html">Plugins</a> - </li> - <li class="none"> - <a href="../../../scm/index.html">SCM</a> - </li> - <li class="none"> - <a href="../../index.html">Shared Components</a> - </li> - <li class="none"> - <a href="../../../surefire/index.html">Surefire</a> - </li> - <li class="none"> - <a href="../../../wagon/index.html">Wagon</a> - </li> - </ul> - <h5>ASF</h5> - <ul> - <li class="none"> - <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink">How Apache Works</a> - </li> - <li class="none"> - <a href="http://www.apache.org/foundation/" class="externalLink">Foundation</a> - </li> - <li class="none"> - <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink">Sponsoring Apache</a> - </li> - <li class="none"> - <a href="http://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a> - </li> - </ul> - <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> - <img alt="Built by Maven" src="../images/logos/maven-feather.png"/> - </a> - - </div> - </div> - <div id="bodyColumn"> - <div id="contentBox"> - <!-- 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. --><div class="section"><h2>Manifest<a name="Manifest"></a></h2><div class="section"><h3>Default Manifest<a nam e="Default_Manifest"></a></h3><p>The default manifest created by Maven Archiver will contain the following bits of information:</p><div class="source"><pre>Manifest-Version: 1.0 -Archiver-Version: Plexus Archiver -Created-By: Apache Maven -Built-By: ${user.name} -Build-Jdk: ${java.version}</pre></div></div><div class="section"><h3>Adding Implementation And Specification Details<a name="Adding_Implementation_And_Specification_Details"></a></h3><p>Starting with version 2.1, Maven Archiver no longer creates the Implementation and Specification details in the manifest by default. If you want them in your manifest you have to say so explicitly in your configuration.</p><p><b>Note:</b> Because this is a recent change in Maven Archiver, different plugins may or may not have started using it yet. Please check the documentation for the plugin you want to use. In this example we use maven-jar-plugin 2.1 which was the first version of that plugin to use this new feature.</p><div class="source"><pre><project> - ... - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.1</version> - ... - <configuration> - <archive> - <manifest> - <addDefaultImplementationEntries>true</addDefaultImplementationEntries> - <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> - </manifest> - </archive> - </configuration> - ... - </plugin> - </plugins> - </build> - ... -</project></pre></div><p>The resulting manifest would contain these pieces of information:</p><div class="source"><pre>Manifest-Version: 1.0 -Archiver-Version: Plexus Archiver -Created-By: Apache Maven -Built-By: ${user.name} -Build-Jdk: ${java.version} -Specification-Title: ${project.name} -Specification-Version: ${project.version} -Specification-Vendor: ${project.organization.name} -Implementation-Title: ${project.name} -Implementation-Version: ${project.version} -Implementation-Vendor-Id: ${project.groupId} -Implementation-Vendor: ${project.organization.name}</pre></div><p><b>Note:</b> If your pom.xml does not have an <tt><organization></tt>/<tt><name></tt> element, then the <tt>Specification-Vendor</tt> and <tt>Implementation-Vendor</tt> entries will <b>not</b> be in the manifest.</p><p><b>Note:</b> If your pom.xml does not have a <tt><name></tt> element, then the <tt>Specification-Title</tt> and <tt>Implementation-Title</tt> entries will have "Unnamed - ${project.groupId}:${project.artifactId}:${project.version}" as their value.</p></div></div> - </div> - </div> - <div class="clear"> - <hr/> - </div> - <div id="footer"> - <div class="xright"> - © 2002-2012 - The Apache Software Foundation - - - <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>. - Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation. - </div> - <div class="clear"> - <hr/> - </div> - </div> - </body> -</html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- + | Generated by Apache Maven Doxia at 2014-10-26 + | Rendered using Apache Maven Stylus Skin 1.5 +--> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>Apache Maven Archiver - Manifest</title> + <style type="text/css" media="all"> + @import url("../css/maven-base.css"); + @import url("../css/maven-theme.css"); + @import url("../css/site.css"); + </style> + <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" /> + <meta name="author" content="Dennis Lundberg" /> + <meta name="Date-Creation-yyyymmdd" content="20080101" /> + <meta name="Date-Revision-yyyymmdd" content="20141026" /> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + +<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> + +<script type="text/javascript">_uacct = "UA-140879-1"; + urchinTracker();</script> + </head> + <body class="composite"> + <div id="banner"> + <a href="../../../" id="bannerLeft"> + <img src="../../../images/apache-maven-project-2.png" alt="" /> + </a> + <span id="bannerRight"> + <img src="../../../images/maven-logo-2.gif" alt="" /> + </span> + <div class="clear"> + <hr/> + </div> + </div> + <div id="breadcrumbs"> + + <div class="xleft"> + <a href="http://www.apache.org/" class="externalLink">Apache</a> + > + <a href="../../../index.html">Maven</a> + > + <a href="../../index.html">Shared Components</a> + > + <a href="../">Apache Maven Archiver</a> + > + Manifest + </div> + <div class="xright"> + Last Published: 2014-10-26 + | Version: 2.6 + </div> + <div class="clear"> + <hr/> + </div> + </div> + <div id="leftColumn"> + <div id="navcolumn"> + + <h5>Overview</h5> + <ul> + <li class="none"> + <a href="../index.html">Introduction</a> + </li> + <li class="none"> + <a href="../apidocs/index.html">JavaDocs</a> + </li> + <li class="none"> + <a href="../xref/index.html">Source Xref</a> + </li> + <li class="none"> + <a href="http://www.apache.org/licenses/" class="externalLink">License</a> + </li> + <li class="none"> + <a href="../download.html">Download</a> + </li> + </ul> + <h5>Examples</h5> + <ul> + <li class="none"> + <strong>Manifest</strong> + </li> + <li class="none"> + <a href="../examples/manifestEntries.html">Manifest Entries</a> + </li> + <li class="none"> + <a href="../examples/manifestSections.html">Manifest Sections</a> + </li> + <li class="none"> + <a href="../examples/classpath.html">Set Up The Classpath</a> + </li> + <li class="none"> + <a href="../examples/manifestFile.html">Use Your Own Manifest File</a> + </li> + </ul> + <h5>Project Documentation</h5> + <ul> + <li class="collapsed"> + <a href="../project-info.html">Project Information</a> + </li> + <li class="collapsed"> + <a href="../project-reports.html">Project Reports</a> + </li> + </ul> + <h5>Maven Projects</h5> + <ul> + <li class="none"> + <a href="../../../ant-tasks/index.html">Ant Tasks</a> + </li> + <li class="none"> + <a href="../../../archetype/index.html">Archetype</a> + </li> + <li class="none"> + <a href="../../../doxia/index.html">Doxia</a> + </li> + <li class="none"> + <a href="../../../jxr/index.html">JXR</a> + </li> + <li class="none"> + <a href="../../../maven-1.x/index.html">Maven 1.x</a> + </li> + <li class="none"> + <a href="../../../index.html">Maven 2 & 3</a> + </li> + <li class="none"> + <a href="../../../pom/index.html">Parent POMs</a> + </li> + <li class="none"> + <a href="../../../plugins/index.html">Plugins</a> + </li> + <li class="none"> + <a href="../../../plugin-tools/index.html">Plugin Tools</a> + </li> + <li class="none"> + <a href="../../../scm/index.html">SCM</a> + </li> + <li class="none"> + <a href="../../index.html">Shared Components</a> + </li> + <li class="none"> + <a href="../../../skins/index.html">Skins</a> + </li> + <li class="none"> + <a href="../../../surefire/index.html">Surefire</a> + </li> + <li class="none"> + <a href="../../../wagon/index.html">Wagon</a> + </li> + </ul> + <h5>ASF</h5> + <ul> + <li class="none"> + <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink">How Apache Works</a> + </li> + <li class="none"> + <a href="http://www.apache.org/foundation/" class="externalLink">Foundation</a> + </li> + <li class="none"> + <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink">Sponsoring Apache</a> + </li> + <li class="none"> + <a href="http://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a> + </li> + </ul> + <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> + <img alt="Built by Maven" src="../images/logos/maven-feather.png"/> + </a> + + </div> + </div> + <div id="bodyColumn"> + <div id="contentBox"> + <!-- 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. --><div class="section"> +<h2>Manifest<a name="Manifest"></a></h2> +<div class="section"> +<h3>Default Manifest<a name="Default_Manifest"></a></h3> +<p>The default manifest created by Maven Archiver will contain the following bits of information:</p> +<div class="source"> +<pre>Manifest-Version: 1.0 +Archiver-Version: Plexus Archiver +Created-By: Apache Maven ${maven.version} +Built-By: ${user.name} +Build-Jdk: ${java.version} +</pre></div></div> +<div class="section"> +<h3>Adding Implementation And Specification Details<a name="Adding_Implementation_And_Specification_Details"></a></h3> +<p>Starting with version 2.1, Maven Archiver no longer creates the Implementation and Specification details in the manifest by default. If you want them in your manifest you have to say so explicitly in your configuration.</p> +<p><b>Note:</b> Because this is a recent change in Maven Archiver, different plugins may or may not have started using it yet. Please check the documentation for the plugin you want to use. In this example we use maven-jar-plugin 2.1 which was the first version of that plugin to use this new feature.</p> +<div class="source"> +<pre><project> + ... + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.1</version> + ... + <configuration> + <archive> + <manifest> + <addDefaultImplementationEntries>true</addDefaultImplementationEntries> + <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> + </manifest> + </archive> + </configuration> + ... + </plugin> + </plugins> + </build> + ... +</project> +</pre></div> +<p>The resulting manifest would contain these pieces of information:</p> +<div class="source"> +<pre>Manifest-Version: 1.0 +Archiver-Version: Plexus Archiver +Created-By: Apache Maven ${maven.version} +Built-By: ${user.name} +Build-Jdk: ${java.version} +Specification-Title: ${project.name} +Specification-Version: ${project.version} +Specification-Vendor: ${project.organization.name} +Implementation-Title: ${project.name} +Implementation-Version: ${project.version} +Implementation-Vendor-Id: ${project.groupId} +Implementation-Vendor: ${project.organization.name} +Implementation-URL: ${project.url} +</pre></div> +<p><b>Note:</b> If your pom.xml does not have an <tt><organization></tt>/<tt><name></tt> element, then the <tt>Specification-Vendor</tt> and <tt>Implementation-Vendor</tt> entries will <b>not</b> be in the manifest.</p> +<p><b>Note:</b> If your pom.xml does not have a <tt><url></tt> element, referenced through interpolation, then the <tt>Implementation-URL</tt> entry will <b>not</b> be in the manifest.</p> +<p><b>Note:</b> If your pom.xml does not have a <tt><name></tt> element, then the <tt>Specification-Title</tt> and <tt>Implementation-Title</tt> entries will have "Unnamed - ${project.groupId}:${project.artifactId}:${project.version}" as their value.</p></div></div> + </div> + </div> + <div class="clear"> + <hr/> + </div> + <div id="footer"> + <div class="xright"> + © 2002-2014 + The Apache Software Foundation + + - <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>. + Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation. + </div> + <div class="clear"> + <hr/> + </div> + </div> + </body> +</html> \ No newline at end of file
