I use Cargo to deploy a maven generated war file to a remote JBoss Server that is already running. Normally that works fine. Cargo is configured to undeploy in mavne's pre-clean-Phase and to deploy in maven's install-phase. That means, if there's an error e.g. in the compile-phase, there will be no deployment. To handle this, I'm using cargo's watchdog. So in the next maven-cycle, when there's no deployable to undeploy, the watchdog should recognize there's nothing to undeploy and corgo should not throw an failure. According to this page, that's exactly what the Watchdog is made for (scroll down to the bottom).
But guess what happend? Cargo generates a build-Failure.
I'm pretty sure, the watchdog itself is working properly, because when I had another issue with the undeployer a few month ago (caused by firewall-settings), the watchdog realised, the undeployment didn't succeed.
I didn't find anything helpful on stackoverflow nor on the cargo-jira-page. I' didn't saw the option to add a ticket for cargo. Mybe someone knows this behaviour and how to fix it.
My 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>