Maven Plugin: Advanced

Starting applications

If you want to start the application without maven waiting for it to exit, use the wildfly-swarm:start goal

Starting multiple applications at once

You can start multiple swarm applications at once using the wildfly-swarm:multistart goal (this is useful for integration testing a set of applications). Each application is specified as a <process> containing an optional <groupId>, an <artifactId>, and an optional <executionId> (useful if you need to launch multiple copies of the same application). Each <process> can also include any configuration that is valid for the wildfly-swarm:start goal.

Example

<build>
  <plugins>
    <plugin>
      <groupId>org.wildfly.swarm</groupId>
      <artifactId>wildfly-swarm-plugin</artifactId>
      <executions>
        <execution>
          <id>multistart</id>
          <phase>pre-integration-test</phase>
          <goals>
            <goal>multistart</goal>
          </goals>
          <configuration>
            <processes>
              <process>
                <artifactId>my-frontend-app</artifactId>
              </process>
              <process>
                <artifactId>my-auth-app</artifactId>
                <properties>
                  <swarm.http.port>8081</swarm.http.port>
                </properties>
                <mainClass>com.example.auth.Main</mainClass>
              </process>
              <process>
                <artifactId>my-indexing-app</artifactId>
                <properties>
                  <swarm.http.port>8082</swarm.http.port>
                </properties>
                <environment>
                  <ENV>test</ENV>
                </environment>
              </process>
            </processes>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Stopping applications

If you have started any applications with either wildfly-swarm:start or wildfly-swarm:multistart, they can be stopped by executing the wildfly-swarm:stop goal.