Community
Participate
Working Groups
Build Identifier: I20110613-1736 maven-war-plugin allows packaging the classes into a separate attached jar artifact instead of war artifact itself. When another project depends on the attached artifact, m2e fails to configure JUunit runner classpath correctly. /target/classes directory of the war project is missing from the classpath. Reproducible: Always Steps to Reproduce: 1. Create project test1, use war packaing and maven-war-plugin <attachClasses> option 2. Create a class under test1/src/main/java 3. Create a test under test1/src/test/java 4. Build the project from the command line - tests succeed, all is fine. 5. Run all tests in test1 project using JDT JUnit runner, all is fine. 6. Create project test2, add dependency on test1, using <classifier>classes</classifier> 7. Add classes and tests in test2/ referencing classes from test1/src/main/java - eclipse reports no compilation, errors. 8. Build test2 project from command line, tests succeed, all is fine. 9. Build test2 using m2e, using external / internal Maven installation, workspace resolution on and off, all is fine. 10. Run tests in test2 using JDT JUunit runner - tests fail with NoClassDefFoundError on classes from test1/src/main/java 11. Set breakpoint in a test inside test2 project before NCDFE is triggered. Examine ClassLoader classpath - test1/target/classes is missing. Interestingly test1/target/test-classes is present!
Created attachment 202625 [details] projects that exhibit described problem
Forgot to add m2e version, sorry. I'm running 1.0.100.20110804-1717
closing old/stale bugreports
Moved to https://github.com/eclipse-m2e/m2e-core/issues/