This sample shows how to deploy the current artifact (EAR or WAR) to a target environment and clean the server after integration tests.
<plugin>
<groupId>com.xebialabs.xldeploy</groupId>
<artifactId>xldeploy-maven-plugin</artifactId>
<version>5.0.3-SNAPSHOT</version>
<executions>
<execution>
<id>deploy-id</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>clean-id</id>
<phase>post-integration-test</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
<configuration>
<environmentId>Environments/MyProjectEnvironment</environmentId>
</configuration>
</plugin>