------
War Manifest Customization
------
Pete Marvin King
------
19 June 2006
~~ Copyright 2006 The Apache Software Foundation.
~~
~~ Licensed under the Apache License, Version 2.0 (the "License");
~~ you may not use this file except in compliance with the License.
~~ You may obtain a copy of the License at
~~
~~ http://www.apache.org/licenses/LICENSE-2.0
~~
~~ Unless required by applicable law or agreed to in writing, software
~~ distributed under the License is distributed on an "AS IS" BASIS,
~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~~ See the License for the specific language governing permissions and
~~ limitations under the License.
~~ NOTE: For help with the syntax of this file, see:
~~ http://maven.apache.org/guides/mini/guide-apt-format.html
War Manifest Customization
The manifest can be customized by configuring the war plugin's archiver.
+--------------------+
[...]
org.apache.maven.plugins
maven-war-plugin
2.0
value
[...]
[...]
+--------------------+
The <<>> would generate this <<>> in your war.
+--------------------+
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By:
Build-Jdk:
Extension-Name:
Specification-Vendor: MyCompany Inc
Implementation-Vendor: MyCompany Inc
Implementation-Title:
Implementation-Version:
manifest_entry: value
+--------------------+
Generating a manifest classpath
Generating a manifest classpath for a war is similar to for a jar, but there are a couple of slight differences since you normally don't want a jar in both the manifest classpath and the WEB-INF/lib. Customize the war plugin's archiver:
+--------------------+
[...]
org.apache.maven.plugins
maven-war-plugin
2.0
true
[...]
[...]
+--------------------+
Now, you can control which dependencies are included in WEB-INF/lib and in the manifest classpath by following these examples. Maven will follow the transitive dependency tree until it gets to artifacts scoped as "provided". Note that no way is shown to include a dependency in WEB-INF/lib but not the manifest classpath.
+--------------------+
[...]
org.foo
bar-jar1
${pom.version}
true
org.foo
bar-jar2
${pom.version}
org.foo
bar-jar1
${pom.version}
provided
[...]
[...]
+--------------------+
Check the {{{http://maven.apache.org/guides/mini/guide-manifest.html}Guide to manifest customization}} for more examples.