使用Cargo插件,可以实现maven远程部署:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.username>tomcat</cargo.remote.username> <!-- Tomcat用户名 -->
<cargo.remote.password>tomcat</cargo.remote.password> <!-- Tomcat密码 -->
<cargo.tomcat.ajp.port>8010</cargo.tomcat.ajp.port> <!-- Ajp端口 -->
</properties>
</configuration>
</configuration>
</plugin>
命令行如下:-mvn cargo:redeploy