tomcat7:exec-war

Full name:

org.apache.tomcat.maven:tomcat7-maven-plugin:2.0:exec-war

Description:

This mojo will create a self executable jar file containing all tomcat classes.

So you will be able to use only: java -jar createjar.jar to run your webapp without need to install an Apache Tomcat instance.

More details here: http://tomcat.apache.org/maven-plugin-2.0-beta-1/executable-war-jar.html

Attributes:

  • Requires a Maven project to be executed.
  • Since version: 2.0.
  • Invokes the execution of the lifecycle phase package prior to executing itself.

Required Parameters

Name Type Since Description
accessLogValveFormat String 2.0 see http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
Default value is: %h %l %u %t %r %s %b %I %D.
User property is: maven.tomcat.exec.war.accessLogValveFormat.
attachArtifact boolean 2.0 Attach or not the generated artifact to the build (use true if you want to install or deploy it)
Default value is: true.
User property is: maven.tomcat.exec.war.attachArtifact.
attachArtifactClassifier String 2.0 the classifier to use for the attached/generated artifact
Default value is: exec-war.
User property is: maven.tomcat.exec.war.attachArtifactClassifier.
attachArtifactClassifierType String 2.0 the type to use for the attached/generated artifact
Default value is: jar.
User property is: maven.tomcat.exec.war.attachArtifactType.
connectorHttpProtocol String 2.0 which connector protocol to use HTTP/1.1 or org.apache.coyote.http11.Http11NioProtocol
Default value is: HTTP/1.1.
User property is: maven.tomcat.exec.war.connectorHttpProtocol.
enableNaming boolean 2.0 to enable naming when starting tomcat
Default value is: false.
User property is: maven.tomcat.exec.war.enableNaming.
finalName String 2.0 Name of the generated exec JAR.
Default value is: ${project.artifactId}-${project.version}-war-exec.jar.
User property is: tomcat.jar.finalName.
mainClass String 2.0 Main class to use for starting the standalone jar.
Default value is: org.apache.tomcat.maven.runner.Tomcat7RunnerCli.
User property is: maven.tomcat.exec.war.mainClass.
path String 2.0 The webapp context path to use for the web application being run. The name to store webapp in exec jar. Do not use /
Default value is: ${project.artifactId}.
User property is: maven.tomcat.path.
pluginArtifacts List 2.0 (no description)
Default value is: ${plugin.artifacts}.

Optional Parameters

Name Type Since Description
buildDirectory File 2.0 (no description)
Default value is: ${project.build.directory}.
extraDependencies List 2.0 list of extra dependencies to add in the standalone tomcat jar: your jdbc driver, mail.jar etc.. Those dependencies will be in root classloader.
extraResources List 2.0 list of extra resources to add in the standalone tomcat jar: your logger configuration etc
pluginWorkDirectory File 2.0 Path under buildDirectory where this mojo may do temporary work.
Default value is: ${project.build.directory}/tomcat7-maven-plugin-exec.
serverXml File 2.0 (no description)
Default value is: src/main/tomcatconf/server.xml.
User property is: maven.tomcat.exec.war.serverXml.
tomcatConfigurationFilesDirectory File 2.0 (no description)
Default value is: src/main/tomcatconf.
User property is: maven.tomcat.exec.war.tomcatConf.
warRunDependencies List 2.0 (no description)

Parameter Details

accessLogValveFormat:

see http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: maven.tomcat.exec.war.accessLogValveFormat
  • Default: %h %l %u %t %r %s %b %I %D

attachArtifact:

Attach or not the generated artifact to the build (use true if you want to install or deploy it)
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: maven.tomcat.exec.war.attachArtifact
  • Default: true

attachArtifactClassifier:

the classifier to use for the attached/generated artifact
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: maven.tomcat.exec.war.attachArtifactClassifier
  • Default: exec-war

attachArtifactClassifierType:

the type to use for the attached/generated artifact
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: maven.tomcat.exec.war.attachArtifactType
  • Default: jar

buildDirectory:

(no description)
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • Default: ${project.build.directory}

connectorHttpProtocol:

which connector protocol to use HTTP/1.1 or org.apache.coyote.http11.Http11NioProtocol
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: maven.tomcat.exec.war.connectorHttpProtocol
  • Default: HTTP/1.1

enableNaming:

to enable naming when starting tomcat
  • Type: boolean
  • Since: 2.0
  • Required: Yes
  • User Property: maven.tomcat.exec.war.enableNaming
  • Default: false

extraDependencies:

list of extra dependencies to add in the standalone tomcat jar: your jdbc driver, mail.jar etc.. Those dependencies will be in root classloader.
  • Type: java.util.List
  • Since: 2.0
  • Required: No

extraResources:

list of extra resources to add in the standalone tomcat jar: your logger configuration etc
  • Type: java.util.List
  • Since: 2.0
  • Required: No

finalName:

Name of the generated exec JAR.
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: tomcat.jar.finalName
  • Default: ${project.artifactId}-${project.version}-war-exec.jar

mainClass:

Main class to use for starting the standalone jar.
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: maven.tomcat.exec.war.mainClass
  • Default: org.apache.tomcat.maven.runner.Tomcat7RunnerCli

path:

The webapp context path to use for the web application being run. The name to store webapp in exec jar. Do not use /
  • 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: 2.0
  • Required: Yes
  • Default: ${plugin.artifacts}

pluginWorkDirectory:

Path under buildDirectory where this mojo may do temporary work.
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • Default: ${project.build.directory}/tomcat7-maven-plugin-exec

serverXml:

(no description)
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.exec.war.serverXml
  • Default: src/main/tomcatconf/server.xml

tomcatConfigurationFilesDirectory:

(no description)
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • User Property: maven.tomcat.exec.war.tomcatConf
  • Default: src/main/tomcatconf

warRunDependencies:

(no description)
  • Type: java.util.List
  • Since: 2.0
  • Required: No