3. 1. create a account for deploy on tomcat
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="username" password="password" roles="manager-gui,manager-script" />
4. 2. setup maven by settings.xml at maven conf dir
the authorization of deploy war to tomcat
http://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/usage.html
5. 3. add maven plug-in setup for your project’s pom.xml
let you project tell maven where the tomcat need to deploy
<build>
….
<!-- For Maven Tomcat Plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>myserver</server>
<path>/myapp</path>
<url>http://serverIP:8080/manager/text</url>
</configuration>
</plugin>
…
</plugins>
</build>
6. 4. jenkins should know how to do
below, to reach the target only need is add
goals ...tomcat7:undeploy ,tomcat7:deploy …. and run jenkins bulid !!