1. Software Version
Apache -- tomcat-7.0.55
Apache-maven-3.2.2
Eclipse-standard-luna-R-win32-x86_64
2. Modify the file
2.1 Tomcat tomcat-users.xml
Add the following User Role Manager-script:
<role rolename="manager-script"/> <role rolename="manager-gui"/> <role rolename="admin-gui"/> <user username="admin" password="admin" roles="manager-script"/>
References
Http: // 127.0.0.1: 8080/docs/manager-howto.html # configuring_manager_application_access
2.2 Maven setting. xml
Add in servers
<server> <id>tomcat7</id> <username>admin</username> <password>admin</password> </server>
2.3 project Pom. xml
<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.0-beta-1</version><configuration><url>http://localhost:8080/manager/text</url><server>tomcat7</server><username>admin</username><password>admin</password></configuration></plugin>
Note: The tomcat7 in the server here must be consistent with the server ID in the setting. xml file of the maven configuration file of the previous 2.2.
Maven command: tomcat7: deploy
For example