I want to extend a maven2 POM to run some post processing on my integration test results. I added a java:exec
plugin and bound it to the post-integration-test
phase.
All is fine when the tests pass but if I get any test failures then the post processing isn't executed.
Question: Is there an option to force a task, regardless of the results of the integration test phase?
Our POM was using the Surefire plugin to execute the integration tests but it looks like that was a mistake. The Failsafe plugin is intended to address this issue. From the documentation:
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.