I have a Maven POM with
post-integration-test phases as follows.
How do I force
post-integration-test phase to be executed even when the
pre-integration-test phase fails? Right now, if
pre-integration-test phase fails the
post-integration-test phase doesn't get executed.
Best How To :
Taken from http://maven.apache.org/surefire/maven-failsafe-plugin/
If you use the Surefire Plugin for running tests, then when you have a test failure, the build will stop at the integration-test phase and your integration test environment will not have been torn down correctly.
The Failsafe Plugin is used during the integration-test and verify phases of the build lifecycle to execute the integration tests of an application. The Failsafe Plugin will not fail the build during the integration-test phase, thus enabling the post-integration-test phase to execute.
NOTE: when running integration tests, you should invoke Maven with the (shorter to type too)