Maven Eclipse TOMCAT7 Integration (2) MAVEN automatically deploys to TOMCAT7

Source: Internet
Author: User
Tags tomcat server

Ensure the TOMCAT7 configuration is complete. Install M2eclipse plug-in;

Here are the specific ways to use it:

  1. TOMCAT7 User and Permissions configuration: In the Conf directory, locate Tomcat-users.xml, add Manager permissions to the user. Here I have used the permissions are added to the Admin user, the specific code is as follows:
    <role rolename="Admin-gui"/><role rolename="Admin-script"/><role rolename="Manager-gui"/><role rolename="Manager-script"/><role rolename="MANAGER-JMX"/><role rolename="Manager-status"/><user username="Admin"password="Password"roles="Manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/>

  2. Maven Server configuration: Locate the Setting.xml file under the Conf directory in the MAVEN installation path, add the user information configured under TOMCAT7 in the <servers> node (ID can be filled in arbitrarily, But username and password must be consistent with step 1)
  3. <server>    <id>tomcat7</id>    <username>admin</username>    <password >password</password></server>

  4. In the <plugins> node of the Web project's Pom.xml file, add the TOMCAT7 maven plugin,
    <plugin>    <groupId>org.apache.tomcat.maven</groupId>    <artifactId> tomcat7-maven-plugin</artifactid>    <version>2.1</version>    <configuration >        <!--note the URL here--        <url>http://localhost:8080/manager/text</url>        <server>tomcat7</server> <!--The name here must be the same as the ID configured in Setting.xml-        <path>/ Mavenproject</path> <!--The name here is the project name--    </configuration></plugin>

  5. Finally, only MVN Tomcat7:redeploy is required (the Tomcat server must be started beforehand)

Run Run Configration

Maven Eclipse TOMCAT7 Integration (2) MAVEN automatically deploys to TOMCAT7

Related Article

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.