Unit tests ending with "*Test" are executed by the standard surefire plugin
Now you can execute all unit tests with mvn install (or test) and integration tests with mvn failsafe:integration-tests. You will get immediate feedback
after the execution of unit tests. The integration tests will be executed afterwards (in a separate Jenkins job).

1. Failsafe comes already with usable configuration - no additional work is needed. You only have to add the plugin configuration from above.
2. You can execute failsafe with a dependent Jenkins build. It will speed-up the main build.

Jean-Marc, if the documentation states that the failsafe plugin is bound to the integration-test lifecycle phase, and I couldn't locate such a claim, though my not finding it doesn't indicate very much, then the documentation appears to be wrong.

I am running and experimenting with Maven 3.0.3 and so far it looks as if no plugins are bound to the integration-test lifecycle phase by default.

I was able to bind the failsafe plugin to the integration-test phase, and once I do that I get the results that you describe, and I witness the behavior that Adam wrote about.

So yes, once bound, mvn <lifecycle phase>, where lifecycle phase is integration-test or greater will fire the surefire plugin and execute the unit tests when it hits the test lifecycle phase and then it will fire the failsafe plugin and execute what it identifies as the integration tests when it hits the integration-test lifecycle phase.

Out of the box with no additional configuration of the failsafe plugin, the plugin will execute any files ending in *IT.java in the standard test code tree. You can modify the location of the integration test code in the failsafe plugin's config section, but I wanted to describe what could be done with the smallest amount of pom customization.

Hi Adam,
Good solution, but I would define this rather as a plugin in the build element than as a dependency:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.8.1</version>
</plugin>