Files
maven-plugins/jar/xdocs/manifest.xml
T
2007-04-23 21:28:38 +00:00

147 lines
5.4 KiB
XML

<?xml version="1.0"?>
<!--
/*
* 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.
*/
-->
<document>
<properties>
<title>The Manifest</title>
</properties>
<body>
<section name="The manifest file">
<p>
Here is a typical manifest file generated by the <code>maven-jar-plugin-1.8</code>:
</p>
<source>Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.4.2_10-b03 (Sun Microsystems Inc.)
Built-By: lukas
Maven-Version: 1.1-beta-3-SNAPSHOT
Name: org/apache/maven
Extension-name: org.apache.maven
Specification-Title: Create jar files
Specification-Vendor: Apache Software Foundation
Specification-Version: 1.8
Implementation-Title: org.apache.maven
Implementation-Vendor: Apache Software Foundation
Implementation-Version: 1.8-SNAPSHOT</source>
<p>
Note that the structure was different and probably not compatible in older versions
of the plugin, see <a href="http://jira.codehaus.org/browse/MPJAR-36">MPJAR-36</a>.
</p>
<subsection name="Default attributes">
<table>
<tr><th>Attribute</th><th>Default value</th></tr>
<tr>
<td><code>Created-By</code></td>
<td>The java version used to generate the manifest file</td>
</tr>
<tr>
<td><code>Built-By</code></td>
<td>${user.name}</td>
</tr>
<tr>
<td><code>Maven-Version</code></td>
<td>${maven.application.version}</td>
</tr>
<tr>
<td><code>Class-Path</code></td>
<td>
See the <code>maven.jar.manifest.classpath.add</code>
<a href="properties.html">property</a>.
</td>
</tr>
<tr>
<td><code>Main-Class</code></td>
<td>
See the <code>maven.jar.mainclass</code>
<a href="properties.html">property</a>.
</td>
</tr>
<tr>
<td><code>Extension-List</code></td>
<td>
See the <code>maven.jar.manifest.extensions.add</code>
<a href="properties.html">property</a>.
</td>
</tr>
<tr>
<td><code>Name</code></td>
<td>${pom.package} with "." (dot) replaced by "/" (slash)</td>
</tr>
<tr>
<td><code>Extension-name</code></td>
<td>${pom.package}</td>
</tr>
<tr>
<td><code>Specification-Title</code></td>
<td>${pom.shortDescription} (trimmed to 46 characters)</td>
</tr>
<tr>
<td><code>Specification-Vendor</code></td>
<td>${pom.organization.name}</td>
</tr>
<tr>
<td><code>Specification-Version</code></td>
<td>
This is constructed from ${pom.currentVersion} in the following way:
first any occurence of the string "<code>-SNAPSHOT</code>" is chopped off,
the rest is then tokenized with a delimiter "." (dot), and
up to three tokens are kept. <strong>Note</strong> that according to
<a href="http://java.sun.com/j2se/1.4.2/docs/guide/versioning/spec/versioning2.html">Sun's specification</a>
this must be a number to compare, so if your ${pom.currentVersion} contains any
non-digit character (apart from "."), the resulting manifest will not be valid.
You should then override this default (see below).
</td>
</tr>
<tr>
<td><code>Implementation-Title</code></td>
<td>${pom.package}</td>
</tr>
<tr>
<td><code>Implementation-Vendor</code></td>
<td>${pom.organization.name}</td>
</tr>
<tr>
<td><code>Implementation-Version</code></td>
<td>${pom.currentVersion}</td>
</tr>
</table>
</subsection>
<subsection name="Overriding default values">
<p>
Any of the above default values can be overridden by specifying
a custom manifest file via the <code>maven.jar.manifest</code>
<a href="properties.html">property</a>. Note that values in manifest
sections (separated from the main section by a blank line) can
only be overridden by also specifying the section name.
For instance, even if you only want to override the
<code>Specification-Version</code> in the example above,
you need at least the following in your custom manifest:
</p>
<source>Name: org/apache/maven
Specification-Version: 1.8.0</source>
</subsection>
</section>
</body>
</document>