war:war

Full name:

org.apache.maven.plugins:maven-war-plugin:2.1-beta-1:war

Description:

Build a WAR file.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • Binds by default to the lifecycle phase: package.

Required Parameters

Name Type Since Description
cacheFile File 2.1-alpha-1 The file containing the webapp structure cache.
outputDirectory String - The directory for the generated WAR.
warName String - The name of the generated WAR.
warSourceDirectory File - Single directory for extra files to include in the WAR.
webappDirectory File - The directory where the webapp is built.
workDirectory File - Directory to unpack dependent WARs into if needed

Optional Parameters

Name Type Since Description
archive MavenArchiveConfiguration - The archive configuration to use. See Maven Archiver Reference.
archiveClasses boolean 2.0.1 Whether a JAR file will be created for the classes in the webapp. Using this optional configuration parameter will make the generated classes to be archived into a jar file and the classes directory will then be excluded from the webapp.
Default value is: false.
attachClasses boolean 2.1-alpha-2 Whether classes (that is the content of the WEB-INF/classes directory) should be attached to the project.
Default value is: false.
classesClassifier String 2.1-alpha-2 The classifier to use for the attached classes artifact.
Default value is: classes.
classifier String - Classifier to add to the generated WAR. If given, the artifact will be an attachment instead. The classifier will not be applied to the jar file of the project - only to the war file.
containerConfigXML File - The path to the context.xml file to use.
dependentWarExcludes String - Deprecated. {0}. use the excludes in the overlay object instead
dependentWarIncludes String - Deprecated. {0}. use the includes in the overlay object instead
escapeString String 2.1-beta-1 Expression preceded with the String won't be interpolated \${foo} will be replaced with ${foo}
escapedBackslashesInFilePath boolean 2.1-alpha-2 To escape interpolated value with windows path c:\foo\bar will be replaced with c:\\foo\\bar
Default value is: false.
failOnMissingWebXml boolean 2.1-alpha-2 Whether or not to fail the build is the web.xml file is missing. Set to false if you want you war built without a web.xml file.
Default value is: true.
filteringDeploymentDescriptors boolean 2.1-alpha-2 To filtering deployment descriptors disabled by default
Default value is: false.
filters List - Filters (property files) to include during the interpolation of the pom.xml.
nonFilteredFileExtensions List 2.1-alpha-2 A list of file extensions to not filtering. will be used for webResources and overlay filtering
outputFileNameMapping String 2.1-alpha-1 The file name mapping to use to copy libraries and tlds. If no file mapping is set (default) the file is copied with its standard name.
overlays List 2.1 The overlays to apply.
packagingExcludes String 2.1-alpha-2 The comma separated list of tokens to exclude from the WAR before packaging. This option may be used to implement the skinny war use case.
packagingIncludes String 2.1-beta-1 The comma separated list of tokens to include in the WAR before packaging. By default everything is included. This option may be used to implement the skinny war use case.
primaryArtifact boolean - Whether this is the main artifact being built. Set to false if you don't want to install or deploy it to the local repository instead of the default one in an execution.
Default value is: true.
useCache boolean 2.1-alpha-1 Whether the cache should be used to save the status of the webapp accross multiple runs.
Default value is: true.
warSourceExcludes String - The comma separated list of tokens to exclude when copying content of the warSourceDirectory.
warSourceIncludes String - The comma separated list of tokens to include when copying content of the warSourceDirectory. Default is '**'.
webResources Resource[] - The list of webResources we want to transfer.
webXml File - The path to the web.xml file to use.

Parameter Details

archive:

The archive configuration to use. See Maven Archiver Reference.
  • Type: org.apache.maven.archiver.MavenArchiveConfiguration
  • Required: No

archiveClasses:

Whether a JAR file will be created for the classes in the webapp. Using this optional configuration parameter will make the generated classes to be archived into a jar file and the classes directory will then be excluded from the webapp.
  • Type: boolean
  • Since: 2.0.1
  • Required: No
  • Expression: ${archiveClasses}
  • Default: false

attachClasses:

Whether classes (that is the content of the WEB-INF/classes directory) should be attached to the project.
  • Type: boolean
  • Since: 2.1-alpha-2
  • Required: No
  • Default: false

cacheFile:

The file containing the webapp structure cache.
  • Type: java.io.File
  • Since: 2.1-alpha-1
  • Required: Yes
  • Expression: ${project.build.directory}/war/work/webapp-cache.xml

classesClassifier:

The classifier to use for the attached classes artifact.
  • Type: java.lang.String
  • Since: 2.1-alpha-2
  • Required: No
  • Default: classes

classifier:

Classifier to add to the generated WAR. If given, the artifact will be an attachment instead. The classifier will not be applied to the jar file of the project - only to the war file.
  • Type: java.lang.String
  • Required: No

containerConfigXML:

The path to the context.xml file to use.
  • Type: java.io.File
  • Required: No
  • Expression: ${maven.war.containerConfigXML}

dependentWarExcludes:

Deprecated. use the excludes in the overlay object instead
The comma separated list of tokens to exclude when doing a war overlay.
  • Type: java.lang.String
  • Required: No

dependentWarIncludes:

Deprecated. use the includes in the overlay object instead
The comma separated list of tokens to include when doing a war overlay. Default is '**'
  • Type: java.lang.String
  • Required: No

escapeString:

Expression preceded with the String won't be interpolated \${foo} will be replaced with ${foo}
  • Type: java.lang.String
  • Since: 2.1-beta-1
  • Required: No
  • Expression: ${maven.war.escapeString}

escapedBackslashesInFilePath:

To escape interpolated value with windows path c:\foo\bar will be replaced with c:\\foo\\bar
  • Type: boolean
  • Since: 2.1-alpha-2
  • Required: No
  • Expression: ${maven.war.escapedBackslashesInFilePath}
  • Default: false

failOnMissingWebXml:

Whether or not to fail the build is the web.xml file is missing. Set to false if you want you war built without a web.xml file.
  • Type: boolean
  • Since: 2.1-alpha-2
  • Required: No
  • Expression: ${failOnMissingWebXml}
  • Default: true

filteringDeploymentDescriptors:

To filtering deployment descriptors disabled by default
  • Type: boolean
  • Since: 2.1-alpha-2
  • Required: No
  • Expression: ${maven.war.filteringDeploymentDescriptors}
  • Default: false

filters:

Filters (property files) to include during the interpolation of the pom.xml.
  • Type: java.util.List
  • Required: No

nonFilteredFileExtensions:

A list of file extensions to not filtering. will be used for webResources and overlay filtering
  • Type: java.util.List
  • Since: 2.1-alpha-2
  • Required: No

outputDirectory:

The directory for the generated WAR.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${project.build.directory}

outputFileNameMapping:

The file name mapping to use to copy libraries and tlds. If no file mapping is set (default) the file is copied with its standard name.
  • Type: java.lang.String
  • Since: 2.1-alpha-1
  • Required: No

overlays:

The overlays to apply.
  • Type: java.util.List
  • Since: 2.1
  • Required: No

packagingExcludes:

The comma separated list of tokens to exclude from the WAR before packaging. This option may be used to implement the skinny war use case.
  • Type: java.lang.String
  • Since: 2.1-alpha-2
  • Required: No

packagingIncludes:

The comma separated list of tokens to include in the WAR before packaging. By default everything is included. This option may be used to implement the skinny war use case.
  • Type: java.lang.String
  • Since: 2.1-beta-1
  • Required: No

primaryArtifact:

Whether this is the main artifact being built. Set to false if you don't want to install or deploy it to the local repository instead of the default one in an execution.
  • Type: boolean
  • Required: No
  • Expression: ${primaryArtifact}
  • Default: true

useCache:

Whether the cache should be used to save the status of the webapp accross multiple runs.
  • Type: boolean
  • Since: 2.1-alpha-1
  • Required: No
  • Expression: ${useCache}
  • Default: true

warName:

The name of the generated WAR.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${project.build.finalName}

warSourceDirectory:

Single directory for extra files to include in the WAR.
  • Type: java.io.File
  • Required: Yes
  • Expression: ${basedir}/src/main/webapp

warSourceExcludes:

The comma separated list of tokens to exclude when copying content of the warSourceDirectory.
  • Type: java.lang.String
  • Required: No

warSourceIncludes:

The comma separated list of tokens to include when copying content of the warSourceDirectory. Default is '**'.
  • Type: java.lang.String
  • Required: No

webResources:

The list of webResources we want to transfer.
  • Type: org.apache.maven.model.Resource[]
  • Required: No

webXml:

The path to the web.xml file to use.
  • Type: java.io.File
  • Required: No
  • Expression: ${maven.war.webxml}

webappDirectory:

The directory where the webapp is built.
  • Type: java.io.File
  • Required: Yes
  • Expression: ${project.build.directory}/${project.build.finalName}

workDirectory:

Directory to unpack dependent WARs into if needed
  • Type: java.io.File
  • Required: Yes
  • Expression: ${project.build.directory}/war/work