Home‎ > ‎Maven‎ > ‎Plugins‎ > ‎


Auto deploying to the Apache Tomcat7 manager.


Auto Deploy

Tomcat Server Configuration

Simply deploy your application by configuring the Tomcat plugin to deploy to the Tomcat7 manager.

1. First Edito the /etc/tomcat7/tomcat-users.xml file.
sudo nano /etc/tomcat7/tomcadt-users.xml
2. Add a user with manager-script permission.
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>

<user username="maven" password="deployPass" roles="manager-script"/>
3. Edit the maven settings.xml
sudo nano ~/.m2/settings.xml
4. And in that settings.xml servers element add:

Maven Tomcat Plugin Configuration

1. Put these properties in the pom.xml
2. Add the Tomcat7 plugin for deploying to the Tomcat manager.
  • To use the manager from maven the path will need to have /text appended to it for it to work properly.
<!-- Tomcat deployment configuration -->
<!-- run 'mvn clean deploy' -->
<!-- run 'mvn tomcat7:deploy -DskipTests -X' debug deploy -->
<!-- add the security credentials to ~/.m2/settings.xml <id>...</id> -->

3. To deploy run 'mvn cleandeploy'.
  • To skip building but upload the war, run 'mvn tomcat7:deploy'.