How to manage Maven2 inter-test dependencies Follow
I have two Maven modules, A and B. Both have main and test directories.
Some of the test code in A depends on the test code in B.
When building in Maven I get the maven-jar-plugin to use the goal test-jar, which generates the test jars too. Then in module A's pom, I put a test-scoped dependency on the tests in module B:
<dependency>
<groupId>com.myapp.package</groupId>
<artifactId>module-B</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
This works perfectly with Maven, but IntelliJ 9.0.2 has trouble with the dependencies - although the code compiles fine in IntelliJ, when I run a unit test in module A, I get a NoClassDefFoundError for the classes required from B.
Is there any way I can globally tell IntelliJ that for each module marked as a test dependency, the test sources should be included too? Any other suggestions/comments are welcome.
Many thanks
Please sign in to leave a comment.
Hi all!
I have exactly the same question!
Any clues are welcome!
Thx
J.
Found the answer here: http://stackoverflow.com/questions/174560/sharing-test-code-in-maven
Use
More background: http://youtrack.jetbrains.net/issue/IDEA-54254