我使用Cargo将maven生成的war文件部署到已经运行的远程JBoss服务器。通常情况下,这可以很好地工作。Cargo被配置为在mavne的预清理阶段取消部署,并在maven的安装阶段进行部署。这意味着,如果在编译阶段出现错误,将不会进行部署。为了解决这个问题,我使用了cargo的看门狗。因此,在下一个maven周期中,当没有可部署的可取消部署时,watchdog应该认识到没有什么可以取消部署,并且corgo不应该抛出失败。根据this页面,这正是创建Watchdog的目的(向下滚动到底部)。
但是猜猜发生了什么?Cargo会生成一个构建失败。
我非常确定,watchdog本身工作正常,因为几个月前,当我遇到另一个问题(由防火墙设置引起)时,watchdog意识到,取消部署没有成功。
我在stackoverflow和cargo-jira-page上都找不到任何有用的东西。我没有看到添加货票的选项。也许有人知道这种行为以及如何纠正它。
我的pom.xml:
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.8</version>
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-controller-client</artifactId>
<version>7.1.0.Final</version>
</dependency>
</dependencies>
<configuration>
<cargo.logging>high</cargo.logging>
<container>
<timeout>300000</timeout>
<containerId>jboss71x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.hostname><myHost></cargo.hostname>
<cargo.jboss.management-native.port>9999</cargo.jboss.management-native.port>
<cargo.remote.username><myUsername></cargo.remote.username>
<cargo.remote.password><myPassword></cargo.remote.password>
</properties>
</configuration>
<deployer>
<type>remote</type>
</deployer>
<deployables>
<deployable>
<groupId><myGroupId></groupId>
<artifactId><myArtifactId></artifactId>
<type>war</type>
<properties>
<context><myContext></context>
</properties>
<location>${project.build.directory}\${project.build.finalName}.${project.packaging}</location>
<pingURL><myPingUrl></pingURL>
<pingTimeout>60000</pingTimeout>
</deployable>
</deployables>
</configuration>
<executions>
<execution>
<id>undeploy</id>
<phase>pre-clean</phase>
<goals>
<goal>undeploy</goal>
</goals>
</execution>
<execution>
<id>deploy</id>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>发布于 2014-06-24 03:53:11
我不确定是什么问题,但是你可以使用一个org.jboss.as.plugins:jboss-as-maven-plugin。
https://stackoverflow.com/questions/24360531
复制相似问题