tomcat:run

Full name:

org.codehaus.mojo:tomcat-maven-plugin:1.2-SNAPSHOT:run

Description:

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

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • Invokes the execution of the lifecycle phase compile prior to executing itself.

Required Parameters

Name Type Since Description
path String - 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}.
pluginArtifacts List 1.0 (no description)

Optional Parameters

Name Type Since Description
addContextWarDependencies boolean 1.0 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.
Default value is: false.
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.
ajpPort int 1.2 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.
Default value is: 0.
ajpProtocol String 1.2 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.
Default value is: ajp.
backgroundProcessorDelay int - represents the delay in seconds between each classPathScanning change invocation
Default value is: -1.
classesDir File - The classes directory for the web application being run.
configurationDir File - The directory to create the Tomcat server configuration under.
contextFile File - The path of the Tomcat context XML file.
contextReloadable boolean 1.2 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.
delegate boolean 1.0 Set the "follow standard delegation model" flag used to configure our ClassLoader.
Default value is: true.
fork boolean 1.0 Set this to true to allow Maven to continue to execute after invoking the run goal.
Default value is: false.
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.
Default value is: 0.
ignorePackaging boolean 1.0 If set to true ignore if packaging of project is not 'war'.
Default value is: false.
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)
port int - The port to run the Tomcat server on.
Default value is: 8080.
serverXml File 1.0-alpha-2 server.xml to use Note if you use this you must configure in this file your webapp paths.
systemProperties Map 1.0-alpha-2 List of System properties to pass to the Tomcat Server.
tomcatWebXml File 1.0-alpha-2 overriding the providing web.xml to run tomcat
uriEncoding String 1.0 The character encoding to use for decoding URIs.
Default value is: ISO-8859-1.
useNaming boolean 1.2

Enables or disables naming support for the embedded Tomcat server. By default the embedded Tomcat in Tomcat 6 comes with naming enabled. In contrast to this the embedded Tomcat 7 comes with naming disabled by default.

With release 1.2 of this plugin useNaming defaults to false as it does for Tomcat 7. To enable it, set this parameter to true or set the property maven.tomcat.useNaming.

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: false.
useSeparateTomcatClassLoader boolean 1.0 if true a new classLoader separated from maven core will be created to start tomcat.
Default value is: false.
warSourceDirectory File - The web resources directory for the web application being run.

Parameter Details

addContextWarDependencies:

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
  • Expression: ${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
  • Expression: ${maven.tomcat.additionalConfigFilesDir}
  • Default: ${basedir}/src/main/tomcatconf

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.
  • Type: int
  • Since: 1.2
  • Required: No
  • Expression: ${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.
  • Type: java.lang.String
  • Since: 1.2
  • Required: No
  • Expression: ${maven.tomcat.ajp.protocol}
  • Default: ajp

backgroundProcessorDelay:

represents the delay in seconds between each classPathScanning change invocation
  • Type: int
  • Required: No
  • Expression: ${maven.tomcat.backgroundProcessorDelay}
  • Default: -1

classesDir:

The classes directory for the web application being run.
  • Type: java.io.File
  • Required: No
  • Expression: ${project.build.outputDirectory}

configurationDir:

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

contextFile:

The path of the Tomcat context XML file.
  • Type: java.io.File
  • Required: No
  • Expression: src/main/webapp/META-INF/context.xml

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: 1.2
  • Required: No
  • Expression: ${maven.tomcat.contextReloadable}
  • Default: false

delegate:

Set the "follow standard delegation model" flag used to configure our ClassLoader.
  • Type: boolean
  • Since: 1.0
  • Required: No
  • Expression: ${tomcat.delegate}
  • Default: true

fork:

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

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.
  • Type: int
  • Since: 1.0
  • Required: No
  • Expression: ${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
  • Expression: ${tomcat.ignorePackaging}
  • Default: false

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

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
  • Required: Yes
  • Expression: ${maven.tomcat.path}
  • Default: /${project.artifactId}

pluginArtifacts:

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

port:

The port to run the Tomcat server on.
  • Type: int
  • Required: No
  • Expression: ${maven.tomcat.port}
  • Default: 8080

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
  • Expression: ${maven.tomcat.serverXml}

systemProperties:

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

tomcatWebXml:

overriding the providing web.xml to run tomcat
  • Type: java.io.File
  • Since: 1.0-alpha-2
  • Required: No
  • Expression: ${maven.tomcat.webXml}

uriEncoding:

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

useNaming:

Enables or disables naming support for the embedded Tomcat server. By default the embedded Tomcat in Tomcat 6 comes with naming enabled. In contrast to this the embedded Tomcat 7 comes with naming disabled by default.

With release 1.2 of this plugin useNaming defaults to false as it does for Tomcat 7. To enable it, set this parameter to true or set the property maven.tomcat.useNaming.

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: 1.2
  • Required: No
  • Expression: ${maven.tomcat.useNaming}
  • Default: false

useSeparateTomcatClassLoader:

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

warSourceDirectory:

The web resources directory for the web application being run.
  • Type: java.io.File
  • Required: No
  • Expression: ${basedir}/src/main/webapp