0

I am using the cargo maven plugin to deploy my application into a glassfish container for integration test:

        <plugin>
          <groupId>org.codehaus.cargo</groupId>
          <artifactId>cargo-maven2-plugin</artifactId>

          <executions>
            <execution>
              <id>pre-integration-test</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>redeploy</goal>
              </goals>
            </execution>
          </executions>

          <configuration>
             <container>
               <containerId>glassfish3x</containerId>
               <home>${glassfish.home}</home>                  
             </container>

            <configuration>
              <properties>
                <cargo.servlet.port>8081</cargo.servlet.port>
                <cargo.glassfish.adminPort>4849</cargo.glassfish.adminPort>
                <cargo.remote.username>${domain.username}</cargo.remote.username>
                <cargo.remote.password>${domain.password}</cargo.remote.password>
                <cargo.glassfish.domain.name>domain1</cargo.glassfish.domain.name>
              </properties>
            </configuration>

             <deployer>
               <type>installed</type>
               <deployables>
                 <deployable>
                   <groupId>de.rwth.swc.xam</groupId>
                   <artifactId>${project.artifactId}</artifactId>
                   <type>ear</type>
                 </deployable>
               </deployables>
             </deployer>
          </configuration>
        </plugin>

The integration test is executed by Hudson. If the deployment fails (regardless of the reason), the cargo plugin produces just a warning like this:

 [INFO] [talledLocalContainer] Deprecated syntax, instead use:
 [INFO] [talledLocalContainer] asadmin --interactive=false --port 4849 --user admin -passwordfile /opt/glassfishv3/.hudson/jobs/XAM Test.Setup.Application/workspace/target/cargo/configurations/glassfish3x/password.properties deploy [options] ...
 [WARNING] [talledLocalContainer] remote failure: Error occurred during deployment: Application with name de.rwth.swc.xam.tests.ear-0.0.1-SNAPSHOT is already registered. Either specify that redeployment must be forced, or redeploy the application. Or if this is a new deployment, pick a different name. Please see server.log for more details.
 [INFO] [talledLocalContainer] Command deploy failed.

The problem is, that this results in the build being sucessfull and therefore triggering other builds.

Is there any way, that I can force cargo to produce a maven build error rather than a info if the deploy command failed?

Matthias
  • 1
  • 1

1 Answers1

0

Based on the sources of the Maven 2 Plugin it doesn't look like this. But i think we should file in an issue about that, cause it could be useful.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235