Below is an example of turning off maven-surefire-plugin during the "test" phase, and turning on maven-surefire-plugin for the "integration-test". The key to turning off "test" phase execution is setting skip=true for the plugin's default configuration (<skip>true</skip>).
| Code Block |
|---|
<!-- skip unit test run, tests to be executed during integration-test --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> <executions> <execution> <id>surefire-it</id> <phase>integration-test</phase> <goals> <goal>test</goal> </goals> <configuration> <skip>false</skip> </configuration> </execution> </executions> </plugin> |
