Modified: maven/website/components/shared-archives/maven-archiver-LATEST/examples/classpath.html ============================================================================== --- maven/website/components/shared-archives/maven-archiver-LATEST/examples/classpath.html (original) +++ maven/website/components/shared-archives/maven-archiver-LATEST/examples/classpath.html Thu Jun 23 12:23:23 2022 @@ -1,393 +1,387 @@ -<!DOCTYPE html> -<!-- - | Generated by Apache Maven Doxia Site Renderer 1.9.2 from src\site\apt/examples\classpath.apt at 2022-01-02 - | Rendered using Apache Maven Fluido Skin 1.9 ---> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> - <head> - <meta charset="UTF-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 1.9.2" /> - <meta name="author" content="Dennis Lundberg" /> - <meta name="date" content="2008-01-01" /> - <title>Apache Maven Archiver – Set Up The Classpath</title> - <link rel="stylesheet" href="../css/apache-maven-fluido-1.9.min.css" /> - <link rel="stylesheet" href="../css/site.css" /> - <link rel="stylesheet" href="../css/print.css" media="print" /> - <script src="../js/apache-maven-fluido-1.9.min.js"></script> - <!-- Google Analytics --> - <script> - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - ga('create', 'UA-140879-1', 'auto'); - ga('send', 'pageview'); - ga('set', 'anonymizeIp', true); - ga('set', 'forceSSL', true); - </script> - </head> - <body class="topBarDisabled"> - <div class="container-fluid"> - <header> - <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../../images/apache-maven-project.png" alt="Apache Maven Archiver"/></a></div> - <div class="pull-right"><a href="../../../" id="bannerRight"><img src="../../../images/maven-logo-black-on-white.png" alt=""/></a></div> - <div class="clear"><hr/></div> - </div> - - <div id="breadcrumbs"> - <ul class="breadcrumb"> - <li class=""><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> - <li class=""><a href="../../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - <li class=""><a href="../../index.html" title="Shared Components">Shared Components</a><span class="divider">/</span></li> - <li class=""><a href="../index.html" title="Apache Maven Archiver">Apache Maven Archiver</a><span class="divider">/</span></li> - <li class="active ">Set Up The Classpath <a href="https://github.com/apache/maven-archiver/tree/maven-archiver-3.5.2/src\site\apt/examples\classpath.apt"><img src="../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2022-01-02</li> - <li id="projectVersion" class="pull-right">Version: 3.5.2</li> - </ul> - </div> - </header> - <div class="row-fluid"> - <header id="leftColumn" class="span2"> - <nav class="well sidebar-nav"> - <ul class="nav nav-list"> - <li class="nav-header">Overview</li> - <li><a href="../index.html" title="Introduction"><span class="none"></span>Introduction</a></li> - <li><a href="../apidocs/index.html" title="JavaDocs"><span class="none"></span>JavaDocs</a></li> - <li><a href="../xref/index.html" title="Source Xref"><span class="none"></span>Source Xref</a></li> - <li><a href="https://www.apache.org/licenses/" class="externalLink" title="License"><span class="none"></span>License</a></li> - <li><a href="../download.html" title="Download"><span class="none"></span>Download</a></li> - <li class="nav-header">Examples</li> - <li><a href="../examples/manifest.html" title="Manifest"><span class="none"></span>Manifest</a></li> - <li><a href="../examples/manifestEntries.html" title="Manifest Entries"><span class="none"></span>Manifest Entries</a></li> - <li><a href="../examples/manifestSections.html" title="Manifest Sections"><span class="none"></span>Manifest Sections</a></li> - <li class="active"><a href="#"><span class="none"></span>Set Up The Classpath</a></li> - <li><a href="../examples/manifestFile.html" title="Use Your Own Manifest File"><span class="none"></span>Use Your Own Manifest File</a></li> - <li class="nav-header">Project Documentation</li> - <li><a href="../project-info.html" title="Project Information"><span class="icon-chevron-right"></span>Project Information</a></li> - <li><a href="../project-reports.html" title="Project Reports"><span class="icon-chevron-right"></span>Project Reports</a></li> - <li class="nav-header">Maven Projects</li> - <li><a href="../../../archetype/index.html" title="Archetype"><span class="none"></span>Archetype</a></li> - <li><a href="../../../resolver/index.html" title="Artifact Resolver"><span class="none"></span>Artifact Resolver</a></li> - <li><a href="../../../doxia/index.html" title="Doxia"><span class="none"></span>Doxia</a></li> - <li><a href="../../../jxr/index.html" title="JXR"><span class="none"></span>JXR</a></li> - <li><a href="../../../ref/current" title="Maven"><span class="none"></span>Maven</a></li> - <li><a href="../../../pom/index.html" title="Parent POMs"><span class="none"></span>Parent POMs</a></li> - <li><a href="../../../plugins/index.html" title="Plugins"><span class="none"></span>Plugins</a></li> - <li><a href="../../../plugin-testing/index.html" title="Plugin Testing"><span class="none"></span>Plugin Testing</a></li> - <li><a href="../../../plugin-tools/index.html" title="Plugin Tools"><span class="none"></span>Plugin Tools</a></li> - <li><a href="../../../apache-resource-bundles/index.html" title="Resource Bundles"><span class="none"></span>Resource Bundles</a></li> - <li><a href="../../../scm/index.html" title="SCM"><span class="none"></span>SCM</a></li> - <li><a href="../../index.html" title="Shared Components"><span class="none"></span>Shared Components</a></li> - <li><a href="../../../skins/index.html" title="Skins"><span class="none"></span>Skins</a></li> - <li><a href="../../../surefire/index.html" title="Surefire"><span class="none"></span>Surefire</a></li> - <li><a href="../../../wagon/index.html" title="Wagon"><span class="none"></span>Wagon</a></li> - <li class="nav-header">ASF</li> - <li><a href="https://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works"><span class="none"></span>How Apache Works</a></li> - <li><a href="https://www.apache.org/foundation/" class="externalLink" title="Foundation"><span class="none"></span>Foundation</a></li> - <li><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsoring Apache"><span class="none"></span>Sponsoring Apache</a></li> - <li><a href="https://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a></li> - </ul> - </nav> - <div class="well sidebar-nav"> -<form id="search-form" action="https://www.google.com/search" method="get" > - <input value="maven.apache.org/shared/maven-archiver/" name="sitesearch" type="hidden"/> - <input class="search-query" name="q" id="query" type="text" /> -</form> -<script>asyncJs( 'https://cse.google.com/brand?form=search-form' )</script> - <hr /> - <div id="poweredBy"> - <div class="clear"></div> - <div id="twitter" style="border:none; margin-top: 10px"> - <a href="https://twitter.com/ASFMavenProject" class="twitter-follow-button" data-show-count="false" data-align="left" data-size="medium" data-show-screen-name="true" data-lang="en">Follow ASFMavenProject</a> - <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> - </div> - <div class="clear"></div> - <div class="clear"></div> -<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a> - </div> - </div> - </header> - <main id="bodyColumn" class="span10" > -<section> -<h2><a name="Set_Up_The_Classpath"></a>Set Up The Classpath</h2><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></section><section> -<h3><a name="Add_A_Class-Path_Entry_To_The_Manifest"></a><a name="Add">Add</a> A Class-Path Entry To The Manifest</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 <code><addClasspath></code> configuration element.</p> -<div class="source"><pre class="prettyprint linenums"><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 class="prettyprint linenums">Manifest-Version: 1.0 -Created-By: Apache Maven ${maven.version} -Build-Jdk: ${java.version} -Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar -</pre></div></section><section> -<h3><a name="Make_The_Jar_Executable"></a><a name="Make">Make</a> The Jar Executable</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 <code><mainClass></code> configuration element. Here is a sample <code>pom.xml</code> configured to add the classpath and use the class <code>fully.qualified.MainClass</code> as the main class:</p> -<div class="source"><pre class="prettyprint linenums"><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 class="prettyprint linenums">Manifest-Version: 1.0 -Created-By: Apache Maven ${maven.version} -Build-Jdk: ${java.version} -Main-Class: fully.qualified.MainClass -Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar -</pre></div></section><section> -<h3><a name="Altering_The_Classpath:_Defining_a_Classpath_Directory_Prefix"></a>Altering The Classpath: Defining a Classpath Directory <a name="Prefix">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 href="/plugins/maven-war-plugin/examples/skinny-wars.html">creating skinny war-files</a>. This can be achieved with the <code><classpathPrefix></code> configuration element.</p> -<div class="source"><pre class="prettyprint linenums"><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="prettyprint linenums">Class-Path: lib/plexus-utils-1.1.jar lib/commons-lang-2.1.jar -</pre></div></section><section> -<h3><a name="Altering_The_Classpath:_Using_a_Maven_Repository-Style_Classpath"></a>Altering The Classpath: Using a Maven <a name="Repository">Repository</a>-Style Classpath</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 <code><classpathLayoutType></code> element with a value of <code>'repository'</code>, like this:</p> -<div class="source"><pre class="prettyprint linenums"><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> - </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="prettyprint linenums">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></section><section> -<h3><a name="Altering_The_Classpath:_Using_a_Custom_Classpath_Format"></a>Altering The Classpath: Using a <a name="Custom">Custom</a> Classpath Format</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 <code><classpathLayoutType></code> element with a value of <code>'custom'</code>, along with the <code><customClasspathLayout></code> element, like this:</p> -<div class="source"><pre class="prettyprint linenums"><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 <code><customClasspathLayout></code> 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. <code>'artifactId'</code> becomes a reference to the method <code>'getArtifactId()'</code>).</li> -<li>Attempt to resolve the expression as a reference to the ArtifactHandler of the current Artifact, again using reflection (eg. <code>'extension'</code> becomes a reference to the method <code>'getExtension()'</code>).</li> -<li>Attempt to resolve the expression as a key in the special-case Properties instance, which contains the following mappings: -<ul> -<li><code>'dashClassifier'</code>: If the Artifact has a classifier, this will be <code>'-$<a name="artifact.classifier">artifact.classifier</a>'</code>, otherwise this is an empty string.</li> -<li><code>'dashClassifier?'</code>: This is a synonym of <code>'dashClassifier'</code>.</li> -<li><code>'groupIdPath'</code>: This is the equivalent of <code>'$<a name="artifact.groupId">artifact.groupId</a>'</code>, with all <code>'.'</code> characters replaced by <code>'/'</code>.</li></ul></li></ol> -<p>The manifest classpath produced using the above configuration would look like this:</p> -<div class="source"><pre class="prettyprint linenums">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></section><section> -<h3><a name="Handling_Snapshot_Versions"></a>Handling <a name="Snapshot">Snapshot</a> Versions</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 <code>'-SNAPSHOT'</code>, or whether the unique timestamp and build-number for that archive is used. For instance, the <a href="/plugins/maven-assembly-plugin">Assembly Plugin</a> allows you to make this decision in the <code><outputFileNameMapping></code> element of its <code><dependencySet</code>> descriptor section.</p><section> -<h4><a name="Forcing_the_use_of_-SNAPSHOT_versions_when_using_the_simple_.28default.29_or_repository_classpath_layout"></a>Forcing the use of -SNAPSHOT versions when using the simple (default) or repository classpath layout</h4> -<p>To force the use of <code>'-SNAPSHOT'</code> version naming, simply disable the <code><useUniqueVersions></code> configuration element, like this:</p> -<div class="source"><pre class="prettyprint linenums"><useUniqueVersions>false</useUniqueVersions> -</pre></div></section><section> -<h4><a name="Forcing_the_use_of_-SNAPSHOT_versions_with_custom_layouts"></a>Forcing the use of -SNAPSHOT versions with custom layouts</h4> -<p>To force the use of <code>'-SNAPSHOT'</code> version naming, simply replace <code>'$<a name="artifact.version">artifact.version</a>'</code> with <code>'$<a name="artifact.baseVersion">artifact.baseVersion</a>'</code> in the custom layout example above, so it looks like this:</p> -<div class="source"><pre class="prettyprint linenums"><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 class="prettyprint linenums"><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></section></section></section> - </main> - </div> - </div> - <hr/> - <footer> - <div class="container-fluid"> - <div class="row-fluid"> - <p>© 2002–2022 -<a href="https://www.apache.org/">The Apache Software Foundation</a> -</p> - </div> - </div> - </footer> - </body> +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.11.1 from src/site/apt/examples/classpath.apt at 2022-06-23 + | Rendered using Apache Maven Fluido Skin 1.9 +--> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 1.11.1" /> + <meta name="author" content="Dennis Lundberg" /> + <meta name="date" content="2008-01-01" /> + <title>Apache Maven Archiver – Set Up The Classpath</title> + <link rel="stylesheet" href="../css/apache-maven-fluido-1.9.min.css" /> + <link rel="stylesheet" href="../css/site.css" /> + <link rel="stylesheet" href="../css/print.css" media="print" /> + <script src="../js/apache-maven-fluido-1.9.min.js"></script> +<!-- Matomo --> +<script> + var _paq = window._paq = window._paq || []; + /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ + /* We explicitly disable cookie tracking to avoid privacy issues */ + _paq.push(['disableCookies']); + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="//analytics.apache.org/"; + _paq.push(['setTrackerUrl', u+'matomo.php']); + _paq.push(['setSiteId', '3']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); + })(); +</script> +<!-- End Matomo Code --> + </head> + <body class="topBarDisabled"> + <div class="container-fluid"> + <header> + <div id="banner"> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../../images/apache-maven-project.png" alt="Apache Maven Archiver"/></a></div> + <div class="pull-right"><a href="../../../" id="bannerRight"><img src="../../../images/maven-logo-black-on-white.png" alt=""/></a></div> + <div class="clear"><hr/></div> + </div> + + <div id="breadcrumbs"> + <ul class="breadcrumb"> + <li class=""><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> + <li class=""><a href="../../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> + <li class=""><a href="../../index.html" title="Shared Components">Shared Components</a><span class="divider">/</span></li> + <li class=""><a href="../index.html" title="Apache Maven Archiver">Apache Maven Archiver</a><span class="divider">/</span></li> + <li class="active ">Set Up The Classpath <a href="https://github.com/apache/maven-archiver/tree/maven-archiver-3.6.0/src/site/apt/examples/classpath.apt"><img src="../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2022-06-23</li> + <li id="projectVersion" class="pull-right">Version: 3.6.0</li> + </ul> + </div> + </header> + <div class="row-fluid"> + <header id="leftColumn" class="span2"> + <nav class="well sidebar-nav"> + <ul class="nav nav-list"> + <li class="nav-header">Overview</li> + <li><a href="../index.html" title="Introduction"><span class="none"></span>Introduction</a></li> + <li><a href="../apidocs/index.html" title="JavaDocs"><span class="none"></span>JavaDocs</a></li> + <li><a href="../xref/index.html" title="Source Xref"><span class="none"></span>Source Xref</a></li> + <li><a href="https://www.apache.org/licenses/" class="externalLink" title="License"><span class="none"></span>License</a></li> + <li><a href="../download.html" title="Download"><span class="none"></span>Download</a></li> + <li class="nav-header">Examples</li> + <li><a href="../examples/manifest.html" title="Manifest"><span class="none"></span>Manifest</a></li> + <li><a href="../examples/manifestEntries.html" title="Manifest Entries"><span class="none"></span>Manifest Entries</a></li> + <li><a href="../examples/manifestSections.html" title="Manifest Sections"><span class="none"></span>Manifest Sections</a></li> + <li class="active"><a href="#"><span class="none"></span>Set Up The Classpath</a></li> + <li><a href="../examples/manifestFile.html" title="Use Your Own Manifest File"><span class="none"></span>Use Your Own Manifest File</a></li> + <li class="nav-header">Project Documentation</li> + <li><a href="../project-info.html" title="Project Information"><span class="icon-chevron-right"></span>Project Information</a></li> + <li><a href="../project-reports.html" title="Project Reports"><span class="icon-chevron-right"></span>Project Reports</a></li> + <li class="nav-header">Maven Projects</li> + <li><a href="../../../archetype/index.html" title="Archetype"><span class="none"></span>Archetype</a></li> + <li><a href="../../../resolver/index.html" title="Artifact Resolver"><span class="none"></span>Artifact Resolver</a></li> + <li><a href="../../../doxia/index.html" title="Doxia"><span class="none"></span>Doxia</a></li> + <li><a href="../../../extensions/index.html" title="Extensions"><span class="none"></span>Extensions</a></li> + <li><a href="../../../jxr/index.html" title="JXR"><span class="none"></span>JXR</a></li> + <li><a href="../../../ref/current" title="Maven"><span class="none"></span>Maven</a></li> + <li><a href="../../../pom/index.html" title="Parent POMs"><span class="none"></span>Parent POMs</a></li> + <li><a href="../../../plugins/index.html" title="Plugins"><span class="none"></span>Plugins</a></li> + <li><a href="../../../plugin-testing/index.html" title="Plugin Testing"><span class="none"></span>Plugin Testing</a></li> + <li><a href="../../../plugin-tools/index.html" title="Plugin Tools"><span class="none"></span>Plugin Tools</a></li> + <li><a href="../../../apache-resource-bundles/index.html" title="Resource Bundles"><span class="none"></span>Resource Bundles</a></li> + <li><a href="../../../scm/index.html" title="SCM"><span class="none"></span>SCM</a></li> + <li><a href="../../index.html" title="Shared Components"><span class="none"></span>Shared Components</a></li> + <li><a href="../../../skins/index.html" title="Skins"><span class="none"></span>Skins</a></li> + <li><a href="../../../surefire/index.html" title="Surefire"><span class="none"></span>Surefire</a></li> + <li><a href="../../../wagon/index.html" title="Wagon"><span class="none"></span>Wagon</a></li> + <li class="nav-header">ASF</li> + <li><a href="https://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works"><span class="none"></span>How Apache Works</a></li> + <li><a href="https://www.apache.org/foundation/" class="externalLink" title="Foundation"><span class="none"></span>Foundation</a></li> + <li><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsoring Apache"><span class="none"></span>Sponsoring Apache</a></li> + <li><a href="https://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a></li> + </ul> + </nav> + <div class="well sidebar-nav"> +<form id="search-form" action="https://www.google.com/search" method="get" > + <input value="maven.apache.org/shared/maven-archiver/" name="sitesearch" type="hidden"/> + <input class="search-query" name="q" id="query" type="text" /> +</form> +<script>asyncJs( 'https://cse.google.com/brand?form=search-form' )</script> + <hr /> + <div id="poweredBy"> + <div class="clear"></div> + <div id="twitter" style="border:none; margin-top: 10px"> + <a href="https://twitter.com/ASFMavenProject" class="twitter-follow-button" data-show-count="false" data-align="left" data-size="medium" data-show-screen-name="true" data-lang="en">Follow ASFMavenProject</a> + <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> + </div> + <div class="clear"></div> + <div class="clear"></div> +<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a> + </div> + </div> + </header> + <main id="bodyColumn" class="span10" > +<section> +<h2><a name="Set_Up_The_Classpath"></a>Set Up The Classpath</h2><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></section><section> +<h3><a name="Add_A_Class-Path_Entry_To_The_Manifest"></a><a name="Add">Add</a> A Class-Path Entry To The Manifest</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 <code><addClasspath></code> configuration element.</p> +<div class="source"><pre class="prettyprint linenums"><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 class="prettyprint linenums">Manifest-Version: 1.0 +Created-By: Apache Maven ${maven.version} +Build-Jdk: ${java.version} +Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar</pre></div></section><section> +<h3><a name="Make_The_Jar_Executable"></a><a name="Make">Make</a> The Jar Executable</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 <code><mainClass></code> configuration element. Here is a sample <code>pom.xml</code> configured to add the classpath and use the class <code>fully.qualified.MainClass</code> as the main class:</p> +<div class="source"><pre class="prettyprint linenums"><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 class="prettyprint linenums">Manifest-Version: 1.0 +Created-By: Apache Maven ${maven.version} +Build-Jdk: ${java.version} +Main-Class: fully.qualified.MainClass +Class-Path: plexus-utils-1.1.jar commons-lang-2.1.jar</pre></div></section><section> +<h3><a name="Altering_The_Classpath:_Defining_a_Classpath_Directory_Prefix"></a>Altering The Classpath: Defining a Classpath Directory <a name="Prefix">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 href="/plugins/maven-war-plugin/examples/skinny-wars.html">creating skinny war-files</a>. This can be achieved with the <code><classpathPrefix></code> configuration element.</p> +<div class="source"><pre class="prettyprint linenums"><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="prettyprint linenums">Class-Path: lib/plexus-utils-1.1.jar lib/commons-lang-2.1.jar</pre></div></section><section> +<h3><a name="Altering_The_Classpath:_Using_a_Maven_Repository-Style_Classpath"></a>Altering The Classpath: Using a Maven <a name="Repository">Repository</a>-Style Classpath</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 <code><classpathLayoutType></code> element with a value of <code>'repository'</code>, like this:</p> +<div class="source"><pre class="prettyprint linenums"><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> + </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="prettyprint linenums">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></section><section> +<h3><a name="Altering_The_Classpath:_Using_a_Custom_Classpath_Format"></a>Altering The Classpath: Using a <a name="Custom">Custom</a> Classpath Format</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 <code><classpathLayoutType></code> element with a value of <code>'custom'</code>, along with the <code><customClasspathLayout></code> element, like this:</p> +<div class="source"><pre class="prettyprint linenums"><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 <code><customClasspathLayout></code> 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. <code>'artifactId'</code> becomes a reference to the method <code>'getArtifactId()'</code>).</li> +<li>Attempt to resolve the expression as a reference to the ArtifactHandler of the current Artifact, again using reflection (eg. <code>'extension'</code> becomes a reference to the method <code>'getExtension()'</code>).</li> +<li>Attempt to resolve the expression as a key in the special-case Properties instance, which contains the following mappings: +<ul> +<li><code>'dashClassifier'</code>: If the Artifact has a classifier, this will be <code>'-$<a name="artifact.classifier">artifact.classifier</a>'</code>, otherwise this is an empty string.</li> +<li><code>'dashClassifier?'</code>: This is a synonym of <code>'dashClassifier'</code>.</li> +<li><code>'groupIdPath'</code>: This is the equivalent of <code>'$<a name="artifact.groupId">artifact.groupId</a>'</code>, with all <code>'.'</code> characters replaced by <code>'/'</code>.</li></ul></li></ol> +<p>The manifest classpath produced using the above configuration would look like this:</p> +<div class="source"><pre class="prettyprint linenums">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></section><section> +<h3><a name="Handling_Snapshot_Versions"></a>Handling <a name="Snapshot">Snapshot</a> Versions</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 <code>'-SNAPSHOT'</code>, or whether the unique timestamp and build-number for that archive is used. For instance, the <a href="/plugins/maven-assembly-plugin">Assembly Plugin</a> allows you to make this decision in the <code><outputFileNameMapping></code> element of its <code><dependencySet</code>> descriptor section.</p><section> +<h4><a name="Forcing_the_use_of_-SNAPSHOT_versions_when_using_the_simple_.28default.29_or_repository_classpath_layout"></a>Forcing the use of -SNAPSHOT versions when using the simple (default) or repository classpath layout</h4> +<p>To force the use of <code>'-SNAPSHOT'</code> version naming, simply disable the <code><useUniqueVersions></code> configuration element, like this:</p> +<div class="source"><pre class="prettyprint linenums"><useUniqueVersions>false</useUniqueVersions></pre></div></section><section> +<h4><a name="Forcing_the_use_of_-SNAPSHOT_versions_with_custom_layouts"></a>Forcing the use of -SNAPSHOT versions with custom layouts</h4> +<p>To force the use of <code>'-SNAPSHOT'</code> version naming, simply replace <code>'$<a name="artifact.version">artifact.version</a>'</code> with <code>'$<a name="artifact.baseVersion">artifact.baseVersion</a>'</code> in the custom layout example above, so it looks like this:</p> +<div class="source"><pre class="prettyprint linenums"><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 class="prettyprint linenums"><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></section></section></section> + </main> + </div> + </div> + <hr/> + <footer> + <div class="container-fluid"> + <div class="row-fluid"> + <p>© 2002–2022 +<a href="https://www.apache.org/">The Apache Software Foundation</a> +</p> + </div> + </div> + </footer> + </body> </html> \ No newline at end of file
Modified: maven/website/components/shared-archives/maven-archiver-LATEST/examples/manifest.html ============================================================================== --- maven/website/components/shared-archives/maven-archiver-LATEST/examples/manifest.html (original) +++ maven/website/components/shared-archives/maven-archiver-LATEST/examples/manifest.html Thu Jun 23 12:23:23 2022 @@ -1,175 +1,179 @@ -<!DOCTYPE html> -<!-- - | Generated by Apache Maven Doxia Site Renderer 1.9.2 from src\site\apt/examples\manifest.apt at 2022-01-02 - | Rendered using Apache Maven Fluido Skin 1.9 ---> -<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> - <head> - <meta charset="UTF-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 1.9.2" /> - <meta name="author" content="Dennis Lundberg" /> - <meta name="date" content="2008-01-01" /> - <title>Apache Maven Archiver – Manifest</title> - <link rel="stylesheet" href="../css/apache-maven-fluido-1.9.min.css" /> - <link rel="stylesheet" href="../css/site.css" /> - <link rel="stylesheet" href="../css/print.css" media="print" /> - <script src="../js/apache-maven-fluido-1.9.min.js"></script> - <!-- Google Analytics --> - <script> - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - ga('create', 'UA-140879-1', 'auto'); - ga('send', 'pageview'); - ga('set', 'anonymizeIp', true); - ga('set', 'forceSSL', true); - </script> - </head> - <body class="topBarDisabled"> - <div class="container-fluid"> - <header> - <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../../images/apache-maven-project.png" alt="Apache Maven Archiver"/></a></div> - <div class="pull-right"><a href="../../../" id="bannerRight"><img src="../../../images/maven-logo-black-on-white.png" alt=""/></a></div> - <div class="clear"><hr/></div> - </div> - - <div id="breadcrumbs"> - <ul class="breadcrumb"> - <li class=""><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> - <li class=""><a href="../../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - <li class=""><a href="../../index.html" title="Shared Components">Shared Components</a><span class="divider">/</span></li> - <li class=""><a href="../index.html" title="Apache Maven Archiver">Apache Maven Archiver</a><span class="divider">/</span></li> - <li class="active ">Manifest <a href="https://github.com/apache/maven-archiver/tree/maven-archiver-3.5.2/src\site\apt/examples\manifest.apt"><img src="../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2022-01-02</li> - <li id="projectVersion" class="pull-right">Version: 3.5.2</li> - </ul> - </div> - </header> - <div class="row-fluid"> - <header id="leftColumn" class="span2"> - <nav class="well sidebar-nav"> - <ul class="nav nav-list"> - <li class="nav-header">Overview</li> - <li><a href="../index.html" title="Introduction"><span class="none"></span>Introduction</a></li> - <li><a href="../apidocs/index.html" title="JavaDocs"><span class="none"></span>JavaDocs</a></li> - <li><a href="../xref/index.html" title="Source Xref"><span class="none"></span>Source Xref</a></li> - <li><a href="https://www.apache.org/licenses/" class="externalLink" title="License"><span class="none"></span>License</a></li> - <li><a href="../download.html" title="Download"><span class="none"></span>Download</a></li> - <li class="nav-header">Examples</li> - <li class="active"><a href="#"><span class="none"></span>Manifest</a></li> - <li><a href="../examples/manifestEntries.html" title="Manifest Entries"><span class="none"></span>Manifest Entries</a></li> - <li><a href="../examples/manifestSections.html" title="Manifest Sections"><span class="none"></span>Manifest Sections</a></li> - <li><a href="../examples/classpath.html" title="Set Up The Classpath"><span class="none"></span>Set Up The Classpath</a></li> - <li><a href="../examples/manifestFile.html" title="Use Your Own Manifest File"><span class="none"></span>Use Your Own Manifest File</a></li> - <li class="nav-header">Project Documentation</li> - <li><a href="../project-info.html" title="Project Information"><span class="icon-chevron-right"></span>Project Information</a></li> - <li><a href="../project-reports.html" title="Project Reports"><span class="icon-chevron-right"></span>Project Reports</a></li> - <li class="nav-header">Maven Projects</li> - <li><a href="../../../archetype/index.html" title="Archetype"><span class="none"></span>Archetype</a></li> - <li><a href="../../../resolver/index.html" title="Artifact Resolver"><span class="none"></span>Artifact Resolver</a></li> - <li><a href="../../../doxia/index.html" title="Doxia"><span class="none"></span>Doxia</a></li> - <li><a href="../../../jxr/index.html" title="JXR"><span class="none"></span>JXR</a></li> - <li><a href="../../../ref/current" title="Maven"><span class="none"></span>Maven</a></li> - <li><a href="../../../pom/index.html" title="Parent POMs"><span class="none"></span>Parent POMs</a></li> - <li><a href="../../../plugins/index.html" title="Plugins"><span class="none"></span>Plugins</a></li> - <li><a href="../../../plugin-testing/index.html" title="Plugin Testing"><span class="none"></span>Plugin Testing</a></li> - <li><a href="../../../plugin-tools/index.html" title="Plugin Tools"><span class="none"></span>Plugin Tools</a></li> - <li><a href="../../../apache-resource-bundles/index.html" title="Resource Bundles"><span class="none"></span>Resource Bundles</a></li> - <li><a href="../../../scm/index.html" title="SCM"><span class="none"></span>SCM</a></li> - <li><a href="../../index.html" title="Shared Components"><span class="none"></span>Shared Components</a></li> - <li><a href="../../../skins/index.html" title="Skins"><span class="none"></span>Skins</a></li> - <li><a href="../../../surefire/index.html" title="Surefire"><span class="none"></span>Surefire</a></li> - <li><a href="../../../wagon/index.html" title="Wagon"><span class="none"></span>Wagon</a></li> - <li class="nav-header">ASF</li> - <li><a href="https://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works"><span class="none"></span>How Apache Works</a></li> - <li><a href="https://www.apache.org/foundation/" class="externalLink" title="Foundation"><span class="none"></span>Foundation</a></li> - <li><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsoring Apache"><span class="none"></span>Sponsoring Apache</a></li> - <li><a href="https://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a></li> - </ul> - </nav> - <div class="well sidebar-nav"> -<form id="search-form" action="https://www.google.com/search" method="get" > - <input value="maven.apache.org/shared/maven-archiver/" name="sitesearch" type="hidden"/> - <input class="search-query" name="q" id="query" type="text" /> -</form> -<script>asyncJs( 'https://cse.google.com/brand?form=search-form' )</script> - <hr /> - <div id="poweredBy"> - <div class="clear"></div> - <div id="twitter" style="border:none; margin-top: 10px"> - <a href="https://twitter.com/ASFMavenProject" class="twitter-follow-button" data-show-count="false" data-align="left" data-size="medium" data-show-screen-name="true" data-lang="en">Follow ASFMavenProject</a> - <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> - </div> - <div class="clear"></div> - <div class="clear"></div> -<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a> - </div> - </div> - </header> - <main id="bodyColumn" class="span10" > -<section> -<h2><a name="Manifest"></a>Manifest</h2><section> -<h3><a name="Default_Manifest"></a>Default Manifest</h3> -<p>The default manifest created by Maven Archiver will contain the following bits of information:</p> -<div class="source"><pre class="prettyprint linenums">Manifest-Version: 1.0 -Created-By: Apache Maven ${maven.version} -Build-Jdk: ${java.version} -</pre></div> -<p><b>Note:</b> The <code>Build-Jdk</code> does not take toolchains configuration into account. It is the same JDK version as running the Maven instance.</p></section><section> -<h3><a name="Adding_Implementation_And_Specification_Details"></a>Adding Implementation And Specification Details</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 class="prettyprint linenums"><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 class="prettyprint linenums">Manifest-Version: 1.0 -Created-By: Apache Maven ${maven.version} -Build-Jdk: ${java.version} -Specification-Title: ${project.name} -Specification-Version: ${project.artifact.selectedVersion.majorVersion}.${project.artifact.selectedVersion.minorVersion} -Specification-Vendor: ${project.organization.name} -Implementation-Title: ${project.name} -Implementation-Version: ${project.version} -Implementation-Vendor: ${project.organization.name} -</pre></div> -<p><b>Note:</b> If your pom.xml does not have an <code><organization></code>/<code><name></code> element, then the <code>Specification-Vendor</code> and <code>Implementation-Vendor</code> entries will <b>not</b> be in the manifest.</p></section></section> - </main> - </div> - </div> - <hr/> - <footer> - <div class="container-fluid"> - <div class="row-fluid"> - <p>© 2002–2022 -<a href="https://www.apache.org/">The Apache Software Foundation</a> -</p> - </div> - </div> - </footer> - </body> +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.11.1 from src/site/apt/examples/manifest.apt at 2022-06-23 + | Rendered using Apache Maven Fluido Skin 1.9 +--> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 1.11.1" /> + <meta name="author" content="Dennis Lundberg" /> + <meta name="date" content="2008-01-01" /> + <title>Apache Maven Archiver – Manifest</title> + <link rel="stylesheet" href="../css/apache-maven-fluido-1.9.min.css" /> + <link rel="stylesheet" href="../css/site.css" /> + <link rel="stylesheet" href="../css/print.css" media="print" /> + <script src="../js/apache-maven-fluido-1.9.min.js"></script> +<!-- Matomo --> +<script> + var _paq = window._paq = window._paq || []; + /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ + /* We explicitly disable cookie tracking to avoid privacy issues */ + _paq.push(['disableCookies']); + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="//analytics.apache.org/"; + _paq.push(['setTrackerUrl', u+'matomo.php']); + _paq.push(['setSiteId', '3']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); + })(); +</script> +<!-- End Matomo Code --> + </head> + <body class="topBarDisabled"> + <div class="container-fluid"> + <header> + <div id="banner"> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../../images/apache-maven-project.png" alt="Apache Maven Archiver"/></a></div> + <div class="pull-right"><a href="../../../" id="bannerRight"><img src="../../../images/maven-logo-black-on-white.png" alt=""/></a></div> + <div class="clear"><hr/></div> + </div> + + <div id="breadcrumbs"> + <ul class="breadcrumb"> + <li class=""><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> + <li class=""><a href="../../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> + <li class=""><a href="../../index.html" title="Shared Components">Shared Components</a><span class="divider">/</span></li> + <li class=""><a href="../index.html" title="Apache Maven Archiver">Apache Maven Archiver</a><span class="divider">/</span></li> + <li class="active ">Manifest <a href="https://github.com/apache/maven-archiver/tree/maven-archiver-3.6.0/src/site/apt/examples/manifest.apt"><img src="../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2022-06-23</li> + <li id="projectVersion" class="pull-right">Version: 3.6.0</li> + </ul> + </div> + </header> + <div class="row-fluid"> + <header id="leftColumn" class="span2"> + <nav class="well sidebar-nav"> + <ul class="nav nav-list"> + <li class="nav-header">Overview</li> + <li><a href="../index.html" title="Introduction"><span class="none"></span>Introduction</a></li> + <li><a href="../apidocs/index.html" title="JavaDocs"><span class="none"></span>JavaDocs</a></li> + <li><a href="../xref/index.html" title="Source Xref"><span class="none"></span>Source Xref</a></li> + <li><a href="https://www.apache.org/licenses/" class="externalLink" title="License"><span class="none"></span>License</a></li> + <li><a href="../download.html" title="Download"><span class="none"></span>Download</a></li> + <li class="nav-header">Examples</li> + <li class="active"><a href="#"><span class="none"></span>Manifest</a></li> + <li><a href="../examples/manifestEntries.html" title="Manifest Entries"><span class="none"></span>Manifest Entries</a></li> + <li><a href="../examples/manifestSections.html" title="Manifest Sections"><span class="none"></span>Manifest Sections</a></li> + <li><a href="../examples/classpath.html" title="Set Up The Classpath"><span class="none"></span>Set Up The Classpath</a></li> + <li><a href="../examples/manifestFile.html" title="Use Your Own Manifest File"><span class="none"></span>Use Your Own Manifest File</a></li> + <li class="nav-header">Project Documentation</li> + <li><a href="../project-info.html" title="Project Information"><span class="icon-chevron-right"></span>Project Information</a></li> + <li><a href="../project-reports.html" title="Project Reports"><span class="icon-chevron-right"></span>Project Reports</a></li> + <li class="nav-header">Maven Projects</li> + <li><a href="../../../archetype/index.html" title="Archetype"><span class="none"></span>Archetype</a></li> + <li><a href="../../../resolver/index.html" title="Artifact Resolver"><span class="none"></span>Artifact Resolver</a></li> + <li><a href="../../../doxia/index.html" title="Doxia"><span class="none"></span>Doxia</a></li> + <li><a href="../../../extensions/index.html" title="Extensions"><span class="none"></span>Extensions</a></li> + <li><a href="../../../jxr/index.html" title="JXR"><span class="none"></span>JXR</a></li> + <li><a href="../../../ref/current" title="Maven"><span class="none"></span>Maven</a></li> + <li><a href="../../../pom/index.html" title="Parent POMs"><span class="none"></span>Parent POMs</a></li> + <li><a href="../../../plugins/index.html" title="Plugins"><span class="none"></span>Plugins</a></li> + <li><a href="../../../plugin-testing/index.html" title="Plugin Testing"><span class="none"></span>Plugin Testing</a></li> + <li><a href="../../../plugin-tools/index.html" title="Plugin Tools"><span class="none"></span>Plugin Tools</a></li> + <li><a href="../../../apache-resource-bundles/index.html" title="Resource Bundles"><span class="none"></span>Resource Bundles</a></li> + <li><a href="../../../scm/index.html" title="SCM"><span class="none"></span>SCM</a></li> + <li><a href="../../index.html" title="Shared Components"><span class="none"></span>Shared Components</a></li> + <li><a href="../../../skins/index.html" title="Skins"><span class="none"></span>Skins</a></li> + <li><a href="../../../surefire/index.html" title="Surefire"><span class="none"></span>Surefire</a></li> + <li><a href="../../../wagon/index.html" title="Wagon"><span class="none"></span>Wagon</a></li> + <li class="nav-header">ASF</li> + <li><a href="https://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works"><span class="none"></span>How Apache Works</a></li> + <li><a href="https://www.apache.org/foundation/" class="externalLink" title="Foundation"><span class="none"></span>Foundation</a></li> + <li><a href="https://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsoring Apache"><span class="none"></span>Sponsoring Apache</a></li> + <li><a href="https://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a></li> + </ul> + </nav> + <div class="well sidebar-nav"> +<form id="search-form" action="https://www.google.com/search" method="get" > + <input value="maven.apache.org/shared/maven-archiver/" name="sitesearch" type="hidden"/> + <input class="search-query" name="q" id="query" type="text" /> +</form> +<script>asyncJs( 'https://cse.google.com/brand?form=search-form' )</script> + <hr /> + <div id="poweredBy"> + <div class="clear"></div> + <div id="twitter" style="border:none; margin-top: 10px"> + <a href="https://twitter.com/ASFMavenProject" class="twitter-follow-button" data-show-count="false" data-align="left" data-size="medium" data-show-screen-name="true" data-lang="en">Follow ASFMavenProject</a> + <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> + </div> + <div class="clear"></div> + <div class="clear"></div> +<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a> + </div> + </div> + </header> + <main id="bodyColumn" class="span10" > +<section> +<h2><a name="Manifest"></a>Manifest</h2><section> +<h3><a name="Default_Manifest"></a>Default Manifest</h3> +<p>The default manifest created by Maven Archiver will contain the following bits of information:</p> +<div class="source"><pre class="prettyprint linenums">Manifest-Version: 1.0 +Created-By: Apache Maven ${maven.version} +Build-Jdk: ${java.version}</pre></div> +<p><b>Note:</b> The <code>Build-Jdk</code> does not take toolchains configuration into account. It is the same JDK version as running the Maven instance.</p></section><section> +<h3><a name="Adding_Implementation_And_Specification_Details"></a>Adding Implementation And Specification Details</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 class="prettyprint linenums"><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 class="prettyprint linenums">Manifest-Version: 1.0 +Created-By: Apache Maven ${maven.version} +Build-Jdk: ${java.version} +Specification-Title: ${project.name} +Specification-Version: ${project.artifact.selectedVersion.majorVersion}.${project.artifact.selectedVersion.minorVersion} +Specification-Vendor: ${project.organization.name} +Implementation-Title: ${project.name} +Implementation-Version: ${project.version} +Implementation-Vendor: ${project.organization.name}</pre></div> +<p><b>Note:</b> If your pom.xml does not have an <code><organization></code>/<code><name></code> element, then the <code>Specification-Vendor</code> and <code>Implementation-Vendor</code> entries will <b>not</b> be in the manifest.</p></section></section> + </main> + </div> + </div> + <hr/> + <footer> + <div class="container-fluid"> + <div class="row-fluid"> + <p>© 2002–2022 +<a href="https://www.apache.org/">The Apache Software Foundation</a> +</p> + </div> + </div> + </footer> + </body> </html> \ No newline at end of file
