My directory structure is like so:
src/integrationTest/java
src/test/java
src/main/java
I a
By default failsafe is configured to only include IT*.java, *IT.java or *ITCase.java. While at the same time, only test sources from src/test/java
are compiled. You need to modify both of these behaviors.
Use build-helper-maven-plugin
to add src/integationTest/java
as test source for maven-compiler-plugin
to pick up automatically. (You've already done this in your last attempt.)
Direct maven-surefire-plugin
to exclude your integration tests (see example below) or to include only non-integration tests (see default includes).
Direct maven-failsafe-plugin
to only include your integration tests instead of default includes.
maven-surefire-plugin
2.17
**/*Stuff.java
maven-failsafe-plugin
2.17
integration-test
verify
**/*Stuff.java
In fact using testClassesDirectory
might also work for limiting scope of each test plugin, but you would have to make changes to maven-compiler-plugin
to output classes to different folders, perhaps splitting it's test-compile
execution into two, so maybe it's not worth the effort.