Reputation:
I have a project containing pom.xml
and some JUnit
tests. Both pom.xml
and unit tests are corrects. But problem is that tests are not in src/test/java folder (I cannot use this folder). Is it possible to tell maven to execute tests from another source folder (which is also in this project)?
Upvotes: 5
Views: 3699
Reputation: 48045
It is enough to add this part to your pom:
<project>
...
<build>
<testSourceDirectory>src/int-test/java</testSourceDirectory>
</build>
...
</project>
The test sources will be compiled during the test-compile
phase and the maven-surefire-plugin
will find the test classes too.
Upvotes: 8