Does anyone know how to workaround the problem where recent M2eclipse plugins fail to include dependent projects test-classes directory in junit launcher's classpath when the test's pom lists the test as a dependency?
Steps to Rep
On commandline all works as expected. TestUtils class found via test classpath.
failure class not found.
When we check the classpath for the test don't see providerProj/test-classes folder. If we close providerProj and rerun, it works and we see provider-test.jar on class path.
useProject
<dependency>
<groupId>workspacetest</groupId>
<artifactId>providerProj</artifactId>
<classifier>test</classifier>
</dependency>
We can manually edit the launchers and add in the necessary folders but that's not ideal. I might be able to convince m2eclipse to dump src and test output into target/classes which would mask the problem and open me up for entangled code. I can fork m2eclipse and change handle to assume that test classifier dep means include workspace resolution target/test-classes.
Do you know of a solution to the problems?
Thanks
Peter
You need to use <classifier>tests</classifier>
.
BTW, http://maven.apache.org/guides/mini/guide-attached-tests.html discourages the use of the tests classifier, <type>test-jar</type>
is preferred.