Do I have to place my integration tests under
src/test
*Integr*Test
*ITTest
src/it
maven-invoker-plugin
You are right that src/it
is intended to be used for integrations test of plugins. This is mentioned in the Standard Directory Layout.
The maven-failsafe-plugin
, by default, will look for your integration tests inside ${project.build.testSourceDirectory}
, which is the same as the maven-surefire-plugin
for unit tests. By default, this corresponds to src/test/java
. The integration tests are made distinct by following a naming convention:
<includes>
<include>**/IT*.java</include>
<include>**/*IT.java</include>
<include>**/*ITCase.java</include>
</includes>
which is different than the naming convention for unit-tests:
<includes>
<include>**/Test*.java</include>
<include>**/*Test.java</include>
<include>**/*TestCase.java</include>
</includes>
So while they would reside in the same source folder (src/test/java
), the difference in names clearly distinguishes them. Also, this is the default set-up so no extra configuration would be needed.
That said, you can have other options:
build-helper-maven-plugin:add-test-source
goal to add the custom folder as a test source folder.