Using for integration testing

This example shows how to use the virtualization-maven-plugin to start and stop a virtual computer which is then used by the integration tests (executed by the failsafe-maven-plugin)

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>virtualization-maven-plugin</artifactId>
        <version>0.0.1-alpha-1-SNAPSHOT</version>
        <configuration>
          <datacenterUri>vcc+vi+https://hostname/sdk</datacenterUri>
          <username>myname</username>
          <password>secret</password>
        </configuration>
        <executions>
          <execution>
            <id>start-database</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start-computer</goal>
            </goals>
            <configuration>
              <computers>
                <computer>My Database Server</computer>
              </computers>
            </configuration>
          </execution>
          <execution>
            <id>stop-database</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>suspend-computer</goal>
            </goals>
            <configuration>
              <computers>
                <computer>My Database Server</computer>
              </computers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>failsafe-maven-plugin</artifactId>
        <version>2.4.3-alpha-1</version>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
          </execution>
          <execution>
            <id>verify</id>
            <goals>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>