1:构建触发器时选择轮训SCM,并且要勾选 《忽略钩子 post-commit》,否则不进行轮询。
2:tomcat的conf下tomcat-users.xml配置管理员账号密码
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<user username="admin" password="xxxx" roles="manager-gui,manager-script,manager-jmx"/>
3:tomcat的webapps下host-manager和manager配置context.xml允许访问的IP
4:构建时选择配置好的maven项
并使用命令:clean install cargo:redeploy
要保证tomcat服务是启动的
5:maven项目的pom.xml配置plugin-cargo
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.15</version>
<configuration>
<container>
<containerId>tomcat8x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.tomcat.manager.url>http://ip:8080/manager</cargo.tomcat.manager.url>
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.password>xxxx</cargo.remote.password>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.hostname>ip</cargo.hostname>
<cargo.tomcat.ajp.port>8009</cargo.tomcat.ajp.port>
</properties>
</configuration>
</configuration>
</plugin>