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:
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.