In Eclipse Helios, the m2eclipse plugin does not include projects in my local workspace in any startup configuration.
I installed this test case:
ProjectA
+ src/main/java/a/TestInA.java
+ pom.xml
ProjectB
+ src/main/java/b/TestInB.java ("main()" calls "a.TestInA.main()")
+ pom.xml (includes reference to ProjectA)
In both projects, the “Allow dependencies on workspace projects” flag is set. This works great when compiling, i.e. The compiler finds a link to "a.TestInA" in "b.TestInB", and the list of "Maven dependencies" contains a link to "ProjectA". But when I try to run "b.TestInB", I get a NoClassDefFoundError:
Exception in thread "main" java.lang.NoClassDefFoundError: a/TestInA
at b.TestInB.main(TestInB.java:13)
Caused by: java.lang.ClassNotFoundException: a.TestInA
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 1 more
In fact, the system property "java.class.path" does not include the folder "target / classes" ProjectA (or any other folder, for that matter).
These are my installed versions:
- Eclipse: Helios Service Release 2 ( : 20110301-1815)
- m2eclipse: 0.12.1 ( : 20110112-1712)