maven自动部署至远程WEB服务器

本文介绍如何使用Cargo插件配置Maven进行远程部署到Tomcat服务器的方法。通过设置Cargo插件的groupId、artifactId及配置项,如Tomcat的用户名、密码和Ajp端口等,实现项目的远程部署。

使用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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值