cargo-maven2-plugin上传部署到tomcat服务器

使用的是cargo-maven2-plugin插件,较为灵活的一个Deploy插件,具体配置如比上面的 tomcat-maven-plugin稍微有点儿复杂,部分还有不清楚,先写上以后再慢慢研究,配置如下:
Xml代码   收藏代码
  1. <build>         
  2.         <plugins>  
  3.         <plugin>  
  4.             <!-- 指定插件名称及版本号 -->  
  5.             <groupId>org.codehaus.cargo</groupId>  
  6.             <artifactId>cargo-maven2-plugin</artifactId>  
  7.             <version>1.0.3</version>  
  8.               
  9.             <!-- 插件的Tomcat6.x配置 -->  
  10.             <configuration>  
  11.                 <wait>true</wait>       <!--是否说明,操作start、stop等后续操作必须等前面操作完成才能继续-->  
  12.                 <container>               <!-- 容器的配置 -->  
  13.                     <containerId>tomcat6x</containerId>               <!-- 指定tomcat版本  -->  
  14.                     <type>installed</type>                                  <!-- 指定类型:standalone, installed等 -->  
  15.                     <home>E:\webServers\apache-tomcat-6.0.32-test</home>    <!-- 指定Tomcat的位置,即catalina.home -->  
  16.                 </container>  
  17.                   
  18.                 <configuration>           <!-- 具体的配置 -->  
  19.                     <type>existing</type>                                   <!-- 类型,existing:存在 -->  
  20.                     <home>E:\webServers\apache-tomcat-6.0.32-test</home>    <!-- Tomcat的位置,即catalina.home -->  
  21.                     <properties>                                          <!-- 配置属性 -->  
  22.                         <cargo.tomcat.manager.url>http://localhost:8080/manager</cargo.tomcat.manager.url>      <!-- 管理地址 -->  
  23.                         <cargo.remote.username>tomcat</cargo.remote.username>                                   <!-- Tomcat用户名 -->  
  24.                         <cargo.remote.password>tomcat</cargo.remote.password>                                   <!-- Tomcat密码 -->  
  25.                         <cargo.tomcat.ajp.port>8009</cargo.tomcat.ajp.port>                                     <!-- Ajp端口 -->  
  26.                     </properties>  
  27.                 </configuration>  
  28.                   
  29.                 <deployer>                                            <!-- 部署配置 -->  
  30.                     <type>installed</type>                          <!-- 类型 -->  
  31.                     <deployables>                                 <!-- 部署设置 -->  
  32.                         <deployable>                              <!-- 部署的War包名等 -->                  
  33.                             <groupId>org.test</groupId>  
  34.                             <artifactId>testwebapp</artifactId>  
  35.                             <type>war</type>  
  36.                             <properties>  
  37.                                 <context>testwebapp</context>   <!-- 部署路径 -->  
  38.                             </properties>  
  39.                         </deployable>  
  40.                     </deployables>  
  41.                 </deployer>  
  42.             </configuration>  
  43.               
  44.             <executions>  
  45.                 <!-- 执行的动作 -->  
  46.                 <execution>  
  47.                     <id>verify-deployer</id>  
  48.                     <phase>install</phase>      <!-- 解析install -->  
  49.                     <goals>  
  50.                         <goal>deployer-deploy</goal>  
  51.                     </goals>  
  52.                 </execution>  
  53.                   
  54.                 <execution>  
  55.                     <id>clean-deployer</id>  
  56.                     <phase>clean</phase>  
  57.                     <goals>  
  58.                         <goal>deployer-undeploy</goal>  
  59.                     </goals>  
  60.                 </execution>  
  61.             </executions>  
  62.         </plugin>  
  63.     </plugins>  
  64. </build>  

不详细的解释在XML当中,直接运行mvn install OK!~~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值