This is driving me insane. The Maven failsafe plugin will not run on my project. If I run mvn verify
only surefire runs. If I type mvn failsafe:verify
Take a look at the failsafe docs for the test names failsafe
expects by default:
**/IT*.java
**/*IT.java
**/*ITCase.java
Are your tests named following one of these patterns? If not, try defining the
element in the plugin configuration. Or change your test name(s) to fit the default pattern.
Okay, now that we've verified the test class names - typically when I add executions to plugin config I do it something like this:
org.apache.maven.plugins
maven-failsafe-plugin
${version.maven.failsafe.plugin}
failsafe-integration-tests
integration-test
integration-test
failsafe-verify
verify
verify
This explicitly binds the failsafe
plugin goals you want to run to the correct phases of the build lifecycle. I believe the surefire
plugin is bound to the test
lifecycle phase by default (for a jar, war, & ejb anyway), but nothing is bound to integration-test
or verify
.