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

来源:互联网 发布:linux sh命令参数 编辑:程序博客网 时间:2024/05/26 02:19

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