Error during Failsafe integration test does not cause failed Maven build
You should call mvn verify
instead of mvn integration-test
.
Quoting the Failsafe Plugin page (emphasis mine):
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)
mvn verify
rather than trying to invoke the integration-test phase directly, as otherwise the post-integration-test phase will not be executed.
You should set the version of the maven-failsafe-plugin. For example to 2.14.1.
And your integration test classes must have ending "IntegrationTest", for example:CustomDaoIntegrationTest