Deploy an artifact and clean the server

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>6.0.0</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>