One, MAVEN configuration
<build><finalName>fish-web</finalName><!-- Publish project to tomcat6 -- ><pluginManagement><plugins><plugin><groupId>org.codehaus.mojo</groupId>< Artifactid>tomcat-maven-plugin</artifactid><version>1.1</version><configuration> <!--<url>http://localhost:8080/manager</url> --><path>/fish-web</path>< username>manager</username><password>manager</password><uriencoding>utf-8</ uriencoding></configuration></plugin> <!-- Publish project to Tomcat7 --> <plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin< /artifactid><version>2.1</version><configuration><!--<url>http://localhost:8080/ manager/text</url>--><path>/fish-web</path><username>manager</username><password>manager</ Password><uriencoding>utf-8</uriencoding></configuration></plugin></plugins> </pluginManagement></build>
Second, the configuration of Tomcat's Tomcat-users.xml
<role rolename= "manager"/><role rolename= "Manager-gui"/><role rolename= "Manager-script"/>< User Username= "manager" password= "manager" roles= "Manager-gui, Manager-script, manager"/>
Iii. execution of the MVN command
Tomcat 6:mvn-dmaven.test.skip=true Tomcat7:redeploy
Tomcat 7:mvn-dmaven.test.skip=true Tomcat:redeploy
This article from "Small Fish Blog" blog, declined reprint!
Maven Integrated Tomcat plugin automatically publishes projects to Tomcat's WebApps directory