I have a multi-module project and I have failsafe defined in the root pom like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19</version>
<configuration>
<includes>
<include>**/*IntegrationTest.java</include>
<include>**/*JourneyTest.java</include>
<include>**/*CucumberFeatureTest.java</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*JourneyTest.java</exclude>
<exclude>**/*CucumberFeatureTest.java</exclude>
</excludes>
</configuration>
</plugin>
Failsafe is not defined anywhere else in my other poms. If I run mvn verify, it skips integration tests (it runs unit tests). But if I run mvn test-compile failsafe:integration-test, it runs integration tests.
I'm under the assumption that failsafe is supposed to run in both of these situations. So why doesn't it run when I type mvn verify?
UPDATE: Just noticed that this was wrapped around these tags:
<build>
<pluginManagement> <!-- oops -->
<plugins>
<plugin>
I feel like this explains the cause, but I'm not sure why unit tests still run like you'd expect with mvn verify and mvn test. Why does surefire work differently from failsafe in this respect?