tomcat:run

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

Mojo Attributes:

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

Required Parameters

Name Type Description
path String The webapp context path to use for the web application being run. This must always start with a forward-slash ('/').

Optional Parameters

Name Type Description
classesDir String The classes directory for the web application being run.
configurationDir String The directory to create the Tomcat server configuration under.
port int The port to run the Tomcat server on. Default value is 8080.
warSourceDirectory String The web resources directory for the web application being run.

Parameter Details

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

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

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: /${project.build.finalName}

port The port to run the Tomcat server on.
  • Type: int
  • Required: No
  • Default: 8080

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