How do I redeploy a maven web application to Tomcat?
Author: Deron Eriksson
Description: This tutorial describes how to redeploy a maven web application to Tomcat using the maven tomcat plugin.
Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1) || Tomcat 6.0.14


Page: < 1 2

(Continued from page 1)

It should be noted that the mavenSW tomcatSW plugin does have a tomcat:redeploy goal, which I tried to use via "mvn clean package tomcat:redeploy". However, my project did not seem to get updated on Tomcat when I tried this. I had much better luck with "mvn clean tomcat:undeploy tomcat:deploy".

I created an EclipseSW External Tool Configuration so that I could click on a project and execute the maven goal by selecting the external tool configuration.

Name:mvn clean tomcat~undeploy tomcat~deploy
Location:C:\dev\apache-maven-2.0.8\bin\mvn.bat
Working Directory:${project_loc}
Arguments:clean tomcat:undeploy tomcat:deploy

The external tool configuration is shown below.

External Tool Configuration

The pom.xml tomcat-maven-plugin reference is shown here:

pom.xml tomcat-maven-plugin reference

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>tomcat-maven-plugin</artifactId>
				<configuration>
					<url>http://192.168.1.7:8080/manager</url>
					<server>mytomcat</server>
					<path>/mywebapp</path>
				</configuration>
			</plugin>
Page: < 1 2