This is how I configured exec and fail-safe plugins. I am using a fail-safe system rather than reconfiguring confidence, as surefire still runs other tests that are in the testing phase. This will perform steps 1 and 2 in the pre-integration phase (several executions listed for the same phase will be performed in the indicated order), run the test in the integration step and then clear steps 3 and 4 in the post-integration step.
(Note: I have echo commands instead of real install and cleanup commands)
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <executions> <execution> <goals> <goal>integration-test</goal> </goals> </execution> </executions> <configuration> <forkMode>always</forkMode> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <id>step1</id> <goals> <goal>exec</goal> </goals> <phase>pre-integration-test</phase> <configuration> <executable>echo</executable> <arguments> <argument>foo</argument> </arguments> </configuration> </execution> <execution> <id>step2</id> <goals> <goal>exec</goal> </goals> <phase>pre-integration-test</phase> <configuration> <executable>echo</executable> <arguments> <argument>bar</argument> </arguments> </configuration> </execution> <execution> <id>step3</id> <goals> <goal>exec</goal> </goals> <phase>post-integration-test</phase> <configuration> <executable>echo</executable> <arguments> <argument>baz</argument> </arguments> </configuration> </execution> <execution> <id>step4</id> <goals> <goal>exec</goal> </goals> <phase>post-integration-test</phase> <configuration> <executable>echo</executable> <arguments> <argument>woot</argument> </arguments> </configuration> </execution> </executions> </plugin>
Slimytadpole
source share