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> <VERSION>${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> </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> ;username</username> <password>password</password> <path> ;/${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)