logo Apache Tomcat Maven Plugin :: Tomcat 7.x

The Tomcat Maven Plugin provides goals to manipulate WAR projects within the Tomcat 7.x servlet container.

homepage: tomcat.apache.org/maven-plugin-trunk
fresh index:
last release: 8 years ago, first release: 10 years ago
packaging: maven-plugin
get this artifact from: central
see this artifact on: search.maven.org


Display vulnerabilities (snyk): Vulnerability check

This chart shows how much is this artifact used as a dependency in other Maven artifacts in Central repository and GitHub:


select version:

Add this snippet into pom.xml inside tag <project><build><plugins>:




Switch to artifact.
goals:
tomcat7:exec-war-only

Same as exec-war goal without forking the package lifecycle.

tomcat7:deploy-only

Deploy a WAR to Tomcat without forking the package lifecycle.

tomcat7:redeploy-only

Redeploy a WAR in Tomcat without forking the package lifecycle. (Alias for the deploy-only goal with its update parameter set to true.)

tomcat7:help

Display help information on tomcat7-maven-plugin. Call mvn tomcat7:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.

tomcat7:shutdown

Shuts down all possibly started embedded Tomcat servers. This will be automatically done through a shutdown hook or you may call this Mojo to shut them down explictly. By default the shutdown goal is not bound to any phase. For integration tests you might want to bind it to post-integration-test.

tomcat7:run-war-only

Same as run-war goal without forking the package cycle.

tomcat7:standalone-war-only

This Mojo will create an executable war file with embedded Tomcat that is also capable of being deployed elsewhere.

tomcat7:run

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

tomcat7:deploy

Deploy a WAR to Tomcat.

tomcat7:standalone-war

This Mojo will create an executable war file with embedded Tomcat that is also capable of being deployed elsewhere.

tomcat7:undeploy

Undeploy a WAR from Tomcat.

tomcat7:run-war

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

tomcat7:redeploy

Redeploy a WAR in Tomcat. (Alias for the deploy goal with its update parameter set to true.)

tomcat7:exec-war

Create a self executable jar file containing all necessary Apache Tomcat classes. This allows for using just java -jar mywebapp.jar to run your webapp without needing to install a Tomcat instance. More details here.

Often used code snippets:

<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <path>/</path>
  </configuration>
</plugin>
<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <port>8080</port>
    <path>/</path>
  </configuration>
</plugin>
<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <server>tomcat-development-server</server>
    <port>9966</port>
    <path>/petclinic</path>
  </configuration>
</plugin>
<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <path>/CounterWebApp</path>
  </configuration>
</plugin>
<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <path>/${project.artifactId}</path>
  </configuration>
</plugin>

© Jiri Pinkas 2015 - 2022. All rights reserved! Admin login To submit bugs / feature requests please use this github page
related: JavaVids | Top Java Blogs | Java školení
Apache and Apache Maven are trademarks of the Apache Software Foundation. The Central Repository is a service mark of Sonatype, Inc.