Maven Plugin Introduction Tomcat7-maven-plugin

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.