(GO) Maven auto-deploy Web project to TOMCAT8 (backwards compatible 7)

Source: Internet
Author: User

maven automatically deploys Web projects to TOMCAT8 (backwards compatible 7) 2014-08-29 10:52

After the website is online, in order to ensure the continuity of the site operation, there is a new feature update, you can not restart the Tomcat server to deploy new features. Therefore, the research on

Check out the automatic deployment feature with Maven.


1 First make sure your computer has a Tomcat server installed

Go to the Tomcat installation directory and open: \conf\tomcat-users.xml, add the following to this configuration file:

<role rolename= "Manager-gui"/><role rolename= "Manager-script"/><user username= "Tomcat" Password= "Tomcat" roles= "Manager-gui,manager-script"/>

Here's the problem: Tomcat8 has restrictions on users: Users configured as Manager-gui can no longer be configured as Manager-script. It is therefore necessary to remove Manager-gui.

Of course, the user name and password can I write different, but two characters must be configured, if not Manager-gui can not be managed by the browser Tomcat program,

You cannot upload a war package to a server with manage without manager-script.


2 The Pom.xml configuration of the Web project needs to download the jar packages and plugins

 <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> < ;p roject.deploy>deploy</project.deploy> <project.tomcat.version>8.0.0-rc5</ Project.tomcat.version> </properties> 
<!--not available here <dependencies> <dependency> <groupid>org.apache.tomcat</gr Oupid> <artifactId>tomcat-servlet-api</artifactId> &LT;VERSION&GT;${PROJECT.TOMCA t.version}</version> <scope>provided</scope> </dependency> </depende ncies> <build> <plugins> <plugin> <groupid>org.apache                  .maven.plugins</groupid> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</sou rce> <target>1.7</target> </configuration> &LT;/PL                  Ugin> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactid>toMcat7-maven-plugin</artifactid> <version>2.2</version> <configurati On> <url>http://localhost:8080/manager/text</url> <username&gt ;username</username> <password>password</password> <path&gt ;/${project.artifactid}</path> </configuration> </plugin> </   Plugins> </build>


3 start Tomcat8, and switch to the project directory via the CD command in the CMD window

Input MVN Tomcat7:deploy

Here we need to explain why it is not tomcat8 but TOMCAT7, because the MAVEN command does not support TOMCAT8, and the input tomcat7 here is actually

Perform the means of deploying the Web program to the Tomcat server.

At this point, the configuration is complete, you can incrementally release new features to the system.


Source: >  

From for notes (Wiz)

(GO) Maven auto-deploy Web project to TOMCAT8 (backwards compatible 7)

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.