Maven Tomcat plug-in for hot deployment

Source: Internet
Author: User

The MAVEN plug-in for Tomcat helps improve development efficiency because:

--You can publish the project directly to a remote server.

--ability to implement thermal deployment of the project, modify Java classes during development, no need to restart Tomcat

First, configure a Tomcat Admin user

1. Modify the Tomcat root path under Conf/tomcat-users.xml to add User Configuration to Tomcat

 <  role  rolename  = "Manager-gui"  Span style= "color: #0000ff;" >/>  <  role  rolename  = "Manager-script"  />  <  user  username  = "admin"   password  = "admin"   roles  = "Manager-gui,manager-script"  />   

Start Tomcat

Enter the value above with the username and password to enter the application management interface

Here we can manage the projects posted to Tomcat

2. You need to configure Tomcat's Maven plugin in the Pom.xml file for the MAVEN project: Tomcat7-maven-plugin, in the Pom.xml configuration file:

<Build>    <Finalname>Taotao</Finalname>    <Plugins>        <plugin>            <groupId>Org.apache.tomcat.maven</groupId>            <Artifactid>Tomcat7-maven-plugin</Artifactid>                <version>2.2</version>               <Configuration>                <URL>http://localhost:8080/manager/text</URL>    <!--Configure the path for Tomcat -                <username>Admin</username>                <Password>Admin</Password>                <uriencoding>UTF-8</uriencoding>   <!--Tomcat URL encoding to achieve and modify the same functionality as the Server.xml file -            </Configuration>        </plugin>    </Plugins></Build>

3. Start Tomcat

Select your Web project in working directory,

In command line, fill in the commands you need.
Tomcat7:deploy publishing a project to a remote server
Tomcat7:run running Tomcat default port is 8080 already supported for hot deployment

Maven Tomcat plug-in for hot deployment

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.