1

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>
Matthias
  • 318
  • 1
  • 7
  • As a Workaround I'm using 'redeploy' in maven's install-Phase, but I'm not totally happy with that. – Matthias Jun 23 '14 at 07:30

1 Answers1

1

I'm not sure what the issue is, but there is a org.jboss.as.plugins:jboss-as-maven-plugin though that you could use.

James R. Perkins
  • 16,800
  • 44
  • 60
  • Thanks! I already tried this plugin, but didn't liked it...actually I forget why I didn't liked it. Maybe I should re-evaluate this plugin. – Matthias Jun 24 '14 at 14:17
  • And if you do please give feedback on why you didn't like it so we can fix it :) – James R. Perkins Jun 25 '14 at 00:29
  • Just as a feedback: I didn't had time to reevaluate the jboss-plugin. My Workaround is still the working solution. – Matthias Aug 08 '14 at 10:25