Maven Eclipse plugin and classpath issues in Eclipse
Posted
by subferno
on Stack Overflow
See other posts from Stack Overflow
or by subferno
Published on 2009-12-28T16:25:13Z
Indexed on
2010/04/07
10:03 UTC
Read the original article
Hit count: 487
I am using Eclipse 3.51, Maven 2.0.9, Java 1.4, with the Maven Eclipse plugin 2.7 with WTP 2.0 (not m2Eclipse).
I have a flat multi module project that is set up as follows (module Parent with the parent pom, module A and B is dependent on C).
Importing the four modules in for the first time will show compile errors as expected since I have not ran the eclipse plugin. With my local repository empty, running eclipse clean will resolve all compile errors and dependencies within the my local workspace.
If I were to make some minor code changes to module B and run the eclipse plugin again, compile errors would show up in module A and B. Compile errors about classes that cannot be found. Its like module C is no longer in the classpath for A and B to see.
I look at the .classpath file and its definitely looking at the right modules in the Eclipse workspace.
If I delete the maven repository and do the eclipse clean again, the compile errors about unresolved classes are fixed. Also, if I run the eclpse clean command with the useProjectReferences flag to false and then rerun it with true, Eclipse would rebuild my workspace and the errors will go away.
Whats going on?
© Stack Overflow or respective owner