The pom.xml dependency of the Tomcat7-maven-plugin plugin is:
<dependency> <groupId>org.apache.tomcat.maven</groupId> <artifactId> Tomcat7-maven-plugin</artifactid> <version>2.2</version></dependency>
One: Run the WebApp project directly
<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin< /artifactid><version>2.2</version><configuration><path>/taobao</path><port >9090</port><uriEncoding>UTF-8</uriEncoding></configuration></plugin>
Execute MVN Tomcat7:run
Access Http://127.0.0.1:9090/taobao
II: Deploy the project to Tomcat
First, configure the Conf/tomcat-users.xml file inside the
<role rolename= "Manager-gui"/><user username= "admin" password= "123456" roles= "Manager,manager-gui"/>
Two methods of deployment
(1)
Configure the plugin directly inside the Pom.xml
<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin< /artifactid><version>2.2</version><configuration><path>/taobao</path><url >http://127.0.0.1:8080/manager/text</url><username>admin</username><password>123456 </password></configuration></plugin>
(2)
<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin< /artifactid><version>2.2</version><configuration><uriencoding>utf-8</uriencoding ><url>http://127.0.0.1:8080/manager/text</url><server>tomcat7</server></ Configuration></plugin>
Then, add the Settting.xml inside
<server><id>tomcat7</id><username>admin</username><password>123456</ Password></server>
Note that the/manager/text above cannot be/manager/html, otherwise 403 error is reported.
Finally, execute MVN tomcat7:deploy to deploy
Access address is: Http://127.0.0.1:8080/taobao
MAVEN Technical Exchange Buckle Group 379165311, the group will occasionally share some Maven articles and tutorials, you are welcome to join
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Maven Plugin Introduction Tomcat7-maven-plugin