------ WAR Manifest Customization ------ Pete Marvin King ------ 2008-08-03 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html WAR Manifest Customization The manifest can be customized by configuring the WAR Plugin's archiver. For full information on the different configuration options available check the documentation for {{{http://maven.apache.org/shared/maven-archiver/index.html}Maven Archiver}}. *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 <<>> directory. Customize the WAR Plugin's archiver: +--------------------+ ... org.apache.maven.plugins maven-war-plugin ${project.version} true ... ... +--------------------+ Now, you can control which dependencies are included in <<>> and in the manifest classpath by following these examples. Maven will follow the transitive dependency tree until it gets to artifacts scoped as "provided". <> No way is shown how to include a dependency in <<>> but not in the manifest classpath. +--------------------+ ... org.foo bar-jar1 ${pom.version} true org.foo bar-jar2 ${pom.version} org.foo bar-jar3 ${pom.version} provided ... ... +--------------------+ Check the {{{http://maven.apache.org/guides/mini/guide-manifest.html}Guide to Working with Manifests}} for more examples.