Community
Participate
Working Groups
Build Identifier: m2e 0.12.1-2011012-1712 In a multimodule project, module A has a test scope dependency on module B. Module B has a test scope dependency on an external library C. According to Maven scope resolution rules, A has _no_ transitive dependency on C, but when running a JUnit test of A from Eclipse, C/test-classes is on the classpath, which leads to incorrect results. Reproducible: Always
Please provide complete standalone sample project and steps to reproduce the problem.
Created attachment 198183 [details] Test case Here is a test case, a parent project with two modules. Import the project into Eclipse and run test-scope-bug-parent/test-scope-client/src/test/java/com/blogspot/hwellmann/testscope/ClasspathTest.java as JUnit test from Eclipse. This will print the classpath to System.out. The output includes .../test-scope-dep/target/test-classes and other dependencies of test-scope-dep. The problem does not occur when the packaging of test-scope-client is jar (not war), so this may be an issue of m2eclipse WTP rather than m2e core. I'm using Maven Integration for WTP (Optional) 0.11.1.20101108-1810
This is a bug in m2e-wtp integration, a separate project hosted at github. This bug appears to have been fixed in recent m2e-wtp builds (see [1]), but I am not familiar with the code enough to tell for sure. [1] http://dev.eclipse.org/mhonarc/lists/m2e-users/msg00692.html PS: FWIW, m2e 1.0.0 generates correct classpath if I change test-scope-client packaging to "jar".
Moved to https://github.com/eclipse-m2e/m2e-core/issues/