I have the default src/test/java
folder for our unit tests. A separate folder src/integration/java
is available for the integration tests.
I configured the maven-surefire-plugin
to execute the unit/integration tests in their respective phases. This works great when the compiled classes are in the correct directory. Unfortunately Maven only supports one test source folder and one test output folder.
With mavens build-helper plugin I could add another test-source folder but the compiled classes will be generated into test-classes
but I want to compile the classes from src/integration/java
into target/integration-test-classes
. Is this possible?
src/test/java > target/test-classes
src/integration/java > target/integration-test-classes
PS: I don't like this exclude/include on package base solution (exclude all **/it/**
files from the default test phase, and exclude all **/unit/**
from the integration phase.