tomcat7:run-war

Full name:

org.apache.tomcat.maven:tomcat7-maven-plugin:2.3-SNAPSHOT:run-war

Description:

Runs the current project as a packaged web application using an embedded Tomcat server.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 2.0.
  • Invokes the execution of the lifecycle phase package prior to executing itself.

Required Parameters

Name Type Since Description
path String 2.0 The webapp context path to use for the web application being run. This must always start with a forward-slash ('/').
Default value is: /${project.artifactId}.
User property is: maven.tomcat.path.
pluginArtifacts List 1.0 (no description)
Default value is: ${plugin.artifacts}.
warDirectory File 2.0 The path of the exploded WAR directory to run.
Default value is: ${project.build.directory}/${project.build.finalName}.
User property is: maven.tomcat.warDirectory.

Optional Parameters

Name Type Since Description
addContextWarDependencies boolean 1.0 Deprecated. use webapps instead
Default value is: false.
User property is: maven.tomcat.addContextWarDependencies.
additionalConfigFilesDir File 1.0-alpha-2 The directory contains additional configuration Files that copied in the Tomcat conf Directory.
Default value is: ${basedir}/src/main/tomcatconf.
User property is: maven.tomcat.additionalConfigFilesDir.
address String 2.2 this IP address will be used on all ports
User property is: maven.tomcat.address.
ajpPort int 2.0 The AJP port to run the Tomcat server on. By default it's 0 this means won't be started. The ajp connector will be started only for value > 0. Will be exposed as System props and session.executionProperties with key tomcat.maven.ajp.port
Default value is: 0.
User property is: maven.tomcat.ajp.port.
ajpProtocol String 2.0 The AJP protocol to run the Tomcat server on. By default it's ajp. NOTE The ajp connector will be started only if ajpPort > 0. possible values are:
  • org.apache.coyote.ajp.AjpProtocol - new blocking Java connector that supports an executor
  • org.apache.coyote.ajp.AjpAprProtocol - the APR/native connector.

Default value is: org.apache.coyote.ajp.AjpProtocol.
User property is: maven.tomcat.ajp.protocol.
aliases String[] 2.0 configure aliases see Host Name aliases
backgroundProcessorDelay int 2.0 represents the delay in seconds between each classPathScanning change invocation
Default value is: -1.
User property is: maven.tomcat.backgroundProcessorDelay.
classLoaderClass String 2.0 Class loader class to set.
clientAuth String 2.1 enable client authentication for https (if configured) see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#SSL_Support_-_BIO_and_NIO
Default value is: false.
User property is: maven.tomcat.https.clientAuth.
configurationDir File 2.0 The directory to create the Tomcat server configuration under.
Default value is: ${project.build.directory}/tomcat.
contextFile File 2.0

The path of the Tomcat context XML file.

Since release 2.0, the file is filtered as a maven resource so you can use interpolation tokens ${ }


User property is: maven.tomcat.contextFile.
contextReloadable boolean 2.0 Force context scanning if you don't use a context file with reloadable = "true". The other way to use contextReloadable is to add attribute reloadable = "true" in your context file.
Default value is: false.
User property is: maven.tomcat.contextReloadable.
fork boolean 1.0 Set this to true to allow Maven to continue to execute after invoking the run goal.
Default value is: false.
User property is: maven.tomcat.fork.
hostName String 2.0 configure host name
Default value is: localhost.
User property is: maven.tomcat.hostName.
httpsPort int 1.0 The https port to run the Tomcat server on. By default it's 0 this means won't be started. The https connector will be started only for value > 0. Will be exposed as System props and session.executionProperties with key tomcat.maven.https.port
Default value is: 0.
User property is: maven.tomcat.httpsPort.
ignorePackaging boolean 1.0 If set to true ignore if packaging of project is not 'war'.
Default value is: false.
User property is: tomcat.ignorePackaging.
jarScanAllDirectories boolean 2.2 In case a module in your reactors has some web-fragments they will be read. If you don't need that for performance reasons, you can deactivate it.
Default value is: true.
User property is: maven.tomcat.jarScan.allDirectories.
keystoreFile String 1.1 Override the default keystoreFile for the HTTPS connector (if enabled)
keystorePass String 1.1 Override the default keystorePass for the HTTPS connector (if enabled)
keystoreType String 2.0 Override the type of keystore file to be used for the server certificate. If not specified, the default value is "JKS".
Default value is: JKS.
maxPostSize int 2.3 The max post size to run the Tomcat server on. By default it's 2097152 bytes. That's the default Tomcat configuration. Set this value to 0 or less to disable the post size limit.
Default value is: 2097152.
User property is: maven.tomcat.maxPostSize.
port int 2.0 The port to run the Tomcat server on. Will be exposed as System props and session.executionProperties with key tomcat.maven.http.port
Default value is: 8080.
User property is: maven.tomcat.port.
propertiesPortFilePath String 2.0 Will dump port in a properties file (see ports for property names). If empty no file generated
User property is: maven.tomcat.propertiesPortFilePath.
protocol String 2.0 The protocol to run the Tomcat server on. By default it's HTTP/1.1. See possible values HTTP Connector protocol attribute
Default value is: HTTP/1.1.
User property is: maven.tomcat.protocol.
serverXml File 1.0-alpha-2 server.xml to use Note if you use this you must configure in this file your webapp paths.
User property is: maven.tomcat.serverXml.
skip boolean 2.0 Skip execution
Default value is: false.
User property is: maven.tomcat.skip.
staticContextDocbase String 2.0 The static context docroot base fully qualified path if null static context won't be added
User property is: maven.tomcat.staticContextDocbase.
staticContextPath String 2.0 The static context
Default value is: /.
User property is: maven.tomcat.staticContextPath.
systemProperties Map 1.0-alpha-2 List of System properties to pass to the Tomcat Server.
tomcatLoggingFile File 2.0 The path of the Tomcat logging configuration.
User property is: maven.tomcat.tomcatLogging.file.
tomcatUsers File 2.0 The path of the Tomcat users XML file.
User property is: maven.tomcat.tomcatUsers.file.
tomcatWebXml File 1.0-alpha-2 overriding the providing web.xml to run tomcat This override the global Tomcat web.xml located in $CATALINA_HOME/conf/
User property is: maven.tomcat.webXml.
trustManagerClassName String 2.2 (no description)
trustMaxCertLength String 2.2 (no description)
truststoreAlgorithm String 2.2 (no description)
truststoreFile String 2.2 (no description)
truststorePass String 2.2 (no description)
truststoreProvider String 2.2 (no description)
truststoreType String 2.2 (no description)
uriEncoding String 1.0 The character encoding to use for decoding URIs.
Default value is: ISO-8859-1.
User property is: maven.tomcat.uriEncoding.
useBodyEncodingForURI boolean 2.2 (no description)
Default value is: false.
User property is: maven.tomcat.useBodyEncodingForURI.
useNaming boolean 2.0

Enables or disables naming support for the embedded Tomcat server.

Note: This setting is ignored if you provide a server.xml for your Tomcat. Instead please configure naming in the server.xml.


Default value is: true.
User property is: maven.tomcat.useNaming.
useSeparateTomcatClassLoader boolean 1.0 if true a new classLoader separated from maven core will be created to start tomcat.
Default value is: false.
User property is: tomcat.useSeparateTomcatClassLoader.
webapps List 2.0 Collection of webapp artifacts to be deployed. Elements are <webapp> and contain usual GAVC plus contextPath and/or contextFile elements.

Parameter Details

addContextWarDependencies:

Deprecated. use webapps instead
Will create a tomcat context for each dependencies of war type with 'scope' set to 'tomcat'. In other words, dependencies with:
   <type>war</type>
   <scope>tomcat</scope>
To preserve backward compatibility it's false by default.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • User Property: maven.tomcat.addContextWarDependencies
  • Default: false

additionalConfigFilesDir:

The directory contains additional configuration Files that copied in the Tomcat conf Directory.
  • Type: java.io.File
  • Since: 1.0-alpha-2
  • Required: No
  • User Property: maven.tomcat.additionalConfigFilesDir
  • Default: ${basedir}/src/main/tomcatconf

address:

this IP address will be used on all ports
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • User Property: maven.tomcat.address

ajpPort:

The AJP port to run the Tomcat server on. By default it's 0 this means won't be started. The ajp connector will be started only for value > 0. Will be exposed as System props and session.executionProperties with key tomcat.maven.ajp.port
  • Type: int
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.ajp.port
  • Default: 0

ajpProtocol:

The AJP protocol to run the Tomcat server on. By default it's ajp. NOTE The ajp connector will be started only if ajpPort > 0. possible values are:
  • org.apache.coyote.ajp.AjpProtocol - new blocking Java connector that supports an executor
  • org.apache.coyote.ajp.AjpAprProtocol - the APR/native connector.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.ajp.protocol
  • Default: org.apache.coyote.ajp.AjpProtocol

aliases:

configure aliases see Host Name aliases
  • Type: java.lang.String[]
  • Since: 2.0
  • Required: No

backgroundProcessorDelay:

represents the delay in seconds between each classPathScanning change invocation
  • Type: int
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.backgroundProcessorDelay
  • Default: -1

classLoaderClass:

Class loader class to set.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No

clientAuth:

enable client authentication for https (if configured) see http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#SSL_Support_-_BIO_and_NIO
  • Type: java.lang.String
  • Since: 2.1
  • Required: No
  • User Property: maven.tomcat.https.clientAuth
  • Default: false

configurationDir:

The directory to create the Tomcat server configuration under.
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • Default: ${project.build.directory}/tomcat

contextFile:

The path of the Tomcat context XML file.

Since release 2.0, the file is filtered as a maven resource so you can use interpolation tokens ${ }

  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.contextFile

contextReloadable:

Force context scanning if you don't use a context file with reloadable = "true". The other way to use contextReloadable is to add attribute reloadable = "true" in your context file.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.contextReloadable
  • Default: false

fork:

Set this to true to allow Maven to continue to execute after invoking the run goal.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • User Property: maven.tomcat.fork
  • Default: false

hostName:

configure host name
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.hostName
  • Default: localhost

httpsPort:

The https port to run the Tomcat server on. By default it's 0 this means won't be started. The https connector will be started only for value > 0. Will be exposed as System props and session.executionProperties with key tomcat.maven.https.port
  • Type: int
  • Since: 1.0
  • Required: No
  • User Property: maven.tomcat.httpsPort
  • Default: 0

ignorePackaging:

If set to true ignore if packaging of project is not 'war'.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • User Property: tomcat.ignorePackaging
  • Default: false

jarScanAllDirectories:

In case a module in your reactors has some web-fragments they will be read. If you don't need that for performance reasons, you can deactivate it.
  • Type: boolean
  • Since: 2.2
  • Required: No
  • User Property: maven.tomcat.jarScan.allDirectories
  • Default: true

keystoreFile:

Override the default keystoreFile for the HTTPS connector (if enabled)
  • Type: java.lang.String
  • Since: 1.1
  • Required: No

keystorePass:

Override the default keystorePass for the HTTPS connector (if enabled)
  • Type: java.lang.String
  • Since: 1.1
  • Required: No

keystoreType:

Override the type of keystore file to be used for the server certificate. If not specified, the default value is "JKS".
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • Default: JKS

maxPostSize:

The max post size to run the Tomcat server on. By default it's 2097152 bytes. That's the default Tomcat configuration. Set this value to 0 or less to disable the post size limit.
  • Type: int
  • Since: 2.3
  • Required: No
  • User Property: maven.tomcat.maxPostSize
  • Default: 2097152

path:

The webapp context path to use for the web application being run. This must always start with a forward-slash ('/').
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: maven.tomcat.path
  • Default: /${project.artifactId}

pluginArtifacts:

(no description)
  • Type: java.util.List
  • Since: 1.0
  • Required: Yes
  • Default: ${plugin.artifacts}

port:

The port to run the Tomcat server on. Will be exposed as System props and session.executionProperties with key tomcat.maven.http.port
  • Type: int
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.port
  • Default: 8080

propertiesPortFilePath:

Will dump port in a properties file (see ports for property names). If empty no file generated
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.propertiesPortFilePath

protocol:

The protocol to run the Tomcat server on. By default it's HTTP/1.1. See possible values HTTP Connector protocol attribute
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.protocol
  • Default: HTTP/1.1

serverXml:

server.xml to use Note if you use this you must configure in this file your webapp paths.
  • Type: java.io.File
  • Since: 1.0-alpha-2
  • Required: No
  • User Property: maven.tomcat.serverXml

skip:

Skip execution
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.skip
  • Default: false

staticContextDocbase:

The static context docroot base fully qualified path if null static context won't be added
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.staticContextDocbase

staticContextPath:

The static context
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.staticContextPath
  • Default: /

systemProperties:

List of System properties to pass to the Tomcat Server.
  • Type: java.util.Map
  • Since: 1.0-alpha-2
  • Required: No

tomcatLoggingFile:

The path of the Tomcat logging configuration.
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.tomcatLogging.file

tomcatUsers:

The path of the Tomcat users XML file.
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.tomcatUsers.file

tomcatWebXml:

overriding the providing web.xml to run tomcat This override the global Tomcat web.xml located in $CATALINA_HOME/conf/
  • Type: java.io.File
  • Since: 1.0-alpha-2
  • Required: No
  • User Property: maven.tomcat.webXml

trustManagerClassName:

(no description)
  • Type: java.lang.String
  • Since: 2.2
  • Required: No

trustMaxCertLength:

(no description)
  • Type: java.lang.String
  • Since: 2.2
  • Required: No

truststoreAlgorithm:

(no description)
  • Type: java.lang.String
  • Since: 2.2
  • Required: No

truststoreFile:

(no description)
  • Type: java.lang.String
  • Since: 2.2
  • Required: No

truststorePass:

(no description)
  • Type: java.lang.String
  • Since: 2.2
  • Required: No

truststoreProvider:

(no description)
  • Type: java.lang.String
  • Since: 2.2
  • Required: No

truststoreType:

(no description)
  • Type: java.lang.String
  • Since: 2.2
  • Required: No

uriEncoding:

The character encoding to use for decoding URIs.
  • Type: java.lang.String
  • Since: 1.0
  • Required: No
  • User Property: maven.tomcat.uriEncoding
  • Default: ISO-8859-1

useBodyEncodingForURI:

(no description)
  • Type: boolean
  • Since: 2.2
  • Required: No
  • User Property: maven.tomcat.useBodyEncodingForURI
  • Default: false

useNaming:

Enables or disables naming support for the embedded Tomcat server.

Note: This setting is ignored if you provide a server.xml for your Tomcat. Instead please configure naming in the server.xml.

  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.useNaming
  • Default: true

useSeparateTomcatClassLoader:

if true a new classLoader separated from maven core will be created to start tomcat.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • User Property: tomcat.useSeparateTomcatClassLoader
  • Default: false

warDirectory:

The path of the exploded WAR directory to run.
  • Type: java.io.File
  • Since: 2.0
  • Required: Yes
  • User Property: maven.tomcat.warDirectory
  • Default: ${project.build.directory}/${project.build.finalName}

webapps:

Collection of webapp artifacts to be deployed. Elements are <webapp> and contain usual GAVC plus contextPath and/or contextFile elements.
  • Type: java.util.List
  • Since: 2.0
  • Required: No