<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.3</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.password>admin</cargo.remote.password>
<cargo.remote.uri>http://192.168.17.194:8080/manager/text</cargo.remote.uri></properties>
</configuration>
<deployables>
<deployable>
<groupId>com.pre</groupId>
<artifactId>pre-dms-devp</artifactId>
<type>war</type>
</deployable>
</deployables>
<executions>
<!-- 执行的动作 -->
<execution>
<id>verify-deployer</id>
<phase>install</phase> <!-- 解析install -->
<goals>
<goal>deployer-redeploy</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 这边cargo.remote.uri,需要用http://192.168.17.194:8080/manager/text 官方文档的英文解释
With Tomcat 7, the Tomcat manager has multiple aspects to be careful about:
- Your browser by default accesses the HTML-based manager whereas CARGO needs to use the text-based manager. As a result, if you want to set the
RemotePropertySet.URI
manually, please make sure you set the URL for the text-based manager, for examplehttp://production27:8080/manager/text
- The text-based manager requires to be accessed by a user with the
manager-script
role; and by default no user has that role. As a result, please make sure you modify yourtomcat-users.xml
file to give that role to a user.
You can read more on the Tomcat documentation: http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html
tomcat-users.xm 配置文件
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-status"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<user username="admin" password="admin" roles="manager-gui,manager-status,manager-script,manager-jmx"/>
</tomcat-users>