Maven Cargo Configuration for JBoss

Note: this configuration will start a separate server for each maven project which may not be desirable for multi-project setups.

<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <version>1.0-beta-2</version>

  <configuration>
    <wait>false</wait>
    <container>
      <containerId>jboss42x</containerId>
      <home>${jboss.server.dir}</home>

      <systemProperties>
        <jboss.server.webserviceport>8083</jboss.server.webserviceport>
        <jboss.server.httpport>8081</jboss.server.httpport>
        <jboss.server.httpsport>443</jboss.server.httpsport>
        <jboss.server.rmiport>1098</jboss.server.rmiport>
        <jboss.server.rmibackupport>1099</jboss.server.rmibackupport>
        <jboss.server.ejb3port>3873</jboss.server.ejb3port>
        <jboss.server.jrmpport>4443</jboss.server.jrmpport>
        <jboss.server.pooledport>4445</jboss.server.pooledport>
        <jboss.server.ajpport>8009</jboss.server.ajpport>
        <jboss.server.webserviceport>8083</jboss.server.webserviceport>
        <jboss.server.remotingport>4446</jboss.server.remotingport>
      </systemProperties>
    </container>
    <configuration>
      <properties>
        <cargo.jboss.configuration>default</cargo.jboss.configuration>
        <cargo.servlet.port>8081</cargo.servlet.port>
      </properties>
      <home>${jboss.server.dir}/server/default</home>
      <implementation>org.codehaus.cargo.container.jboss.JBossExistingLocalConfiguration </implementation>
      <type>existing</type>
    </configuration>
  </configuration>
  <executions>
    <execution>
      <id>start-container</id>
      <phase>pre-integration-test</phase>
      <goals>
        <goal>start</goal>
        <goal>deploy</goal>
      </goals>
    </execution>
    <execution>
      <id>stop-container</id>
      <phase>post-integration-test</phase>
      <goals>
        <goal>stop</goal>
      </goals>
    </execution>
  </executions>
</plugin>