1、配置maven的settings.xml添加一个server:
<server>
<id>myserver</id>
<username>uername</username>
<password>******</password>
</server>
2、pom配置如下:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<path>/test</path>
<url>http://localhost:8080/manager/</url>
<server>myserver</server>
</configuration>
</plugin>
3、conf tomcat-users.xml
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="tomcat" password="s3cret" roles="manager-gui, manager-script"/>
</tomcat-users>
3运行:run as-->maven build... -->Goals tomcat:deploy