java - Force execution of a Maven phase -
i have maven pom pre-integration-test
, post-integration-test
phases follows.
<execution> <id>start-server</id> <phase>pre-integration-test</phase> <goals> <goal>start-server</goal> </goals> <configuration> </configuration> </execution> <execution> <id>stop-running-server</id> <phase>post-integration-test</phase> <goals> <goal>stop-server</goal> </goals> <configuration> <skip>false</skip> </configuration> </execution>
how force post-integration-test
phase executed when pre-integration-test
phase fails? right now, if pre-integration-test
phase fails post-integration-test
phase doesn't executed.
taken http://maven.apache.org/surefire/maven-failsafe-plugin/
if use surefire plugin running tests, when have test failure, build stop @ integration-test phase , integration test environment not have been torn down correctly.
the failsafe plugin used during integration-test , verify phases of build lifecycle execute integration tests of application. failsafe plugin not fail build during integration-test phase, enabling post-integration-test phase execute.
note: when running integration tests, should invoke maven (shorter type too)
Comments
Post a Comment