利用Maven2的插件方式通过Cargo来远程部署应用到Jboss7上

时间:2021-12-15 00:05:07

小弟一直深信CSDN的程序员都是牛人、神人级别的大拿,也看到过很多的问题在CSDN上都得到了圆满的解决方案,小弟我怀着膜拜的心情来CSDN下发表了如下博客的文章,初来乍到,懵懂江湖路还望前辈们多加指导,小弟不甚感激。

近日,小弟在研究Cargo这个优秀的部署工具,就想试着看看能不能把我本地的maven应用部署到远程的服务器上,可参照网上给出的各种方案,甚至是上了官网,查看了cargo的配置部署(http://cargo.codehaus.org/Deploying+to+a+running+container)都没有成功!

如下是我pom文件的配置:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.cargo</groupId>
 <artifactId>cargo</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <packaging>war</packaging>
 <build>
  <finalName>cargo</finalName>
  <plugins>
   <plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.4.5</version>
    <configuration>
     <container>
      <containerId>jboss71x</containerId>
      <type>remote</type>
     </container>
     <configuration>
      <type>runtime</type>
      <properties>
       <cargo.hostname>192.168.88.128</cargo.hostname>
       <cargo.servlet.port>8080</cargo.servlet.port>
       <cargo.protocol>http</cargo.protocol>
       <cargo.rmi.port>1099</cargo.rmi.port>
       <cargo.remote.username>cargo</cargo.remote.username>
       <cargo.remote.password>cargo@163</cargo.remote.password>
      </properties>
     </configuration>
     
      <deployables>
       <deployable>
        <groupId>${project.groupId}</groupId>
        <artifactId>${project.artifactId}</artifactId>
        <type>war</type>
        <pingURL>http://192.168.88.128:8080/${artifactId}</pingURL>
        <properties>
         <context>/${project.artifactId}</context>
        </properties>
       </deployable>
      </deployables>
    </configuration>
    <!-- <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-controller-client</artifactId>
     <version>7.0.2.Final</version> </dependency> </dependencies> -->
   </plugin>
  </plugins>
 </build>
</project>

Maven项目工程是一个空的结构,没写代码,我想跟项目本身就没关了吧。

我启动了远程的Jboss7之后,在eclipse里面执行如下run configruations的配置:

利用Maven2的插件方式通过Cargo来远程部署应用到Jboss7上 

控制台报了如下的错误:

Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.5:run (default-cli) on project cargo: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.5:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [jboss71x], type = [remote]], configuration type [runtime]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]

试了很多种办法,小弟愚钝,还是没有解决问题,所以烦请大神们帮帮忙啊!