1 tomcat-users.xml文件中以下配置:tomcat
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="freebird" password="123456" roles="manager-gui, manager-script" /> maven
2 Maven工程中pom.xml文件以下配置:ui
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://192.168.1.200:8080/manager/text</url>
<server>test</server>
<path>/MyService</path>
</configuration>
</plugin>
3 在~/.m2/settings.xml文件中以下配置:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>test</id>
<username>freebird</username>
<password>123456</password>
</server>
</servers>
</settings>
4 執行:
mvn tomcat:deployurl