I have added the following plugin in the pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<includes>
<include>**/IT*.java</include>
</includes>
<testSourceDirectory>${basedir}/src/integration-test/java</testSourceDirectory>
<testClassesDirectory>${project.build.directory}/it-classes</testClassesDirectory>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
And I have a test under the directory src\integration-test\java called ITSample.java with @Test annotations.
Maven reports
[DEBUG] (s) skip = false
[DEBUG] (s) skipITs = false
[DEBUG] (s) skipTests = false
[DEBUG] (s) testSourceDirectory = ...\src\integration-test\java
[DEBUG] (s) testClassesDirectory = ...\target\it-classes
[DEBUG] (s) includes = [**/IT*.java]
Which seem as intended, but when I run mvn failsafe:integration-test I get back from maven:
[INFO] No tests to run.
Any ideas if I am missing anything or I should set up something differently?
One more thing I noticed is that when I run mvn integration-test
the failsafe plugin is not executed.