views:

294

answers:

3

I am using Eclipse 3.5, Maven 2.0.9 for my multi module Java project in one single workspace.

My plugin declaration is below:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.7</version>
<configuration>
<ajdtVersion>2.0</ajdtVersion>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>

If my local repository is empty, doing an eclipse clean on my project will bring in the correct dependencies and resolve all compile errors.

Once in awhile, a module is not able to see classes in another module that it is dependent on. Doing a clean or local installation won't resolve the compilation error. If I empty the local repo and do the eclipse clean again, the previously unresolved errors are fixed.

This is getting annoying. Anybody know whats wrong?

A: 

I remember having a problem with same kind of symptoms. It was related to specific version of maven-eclipse-plugin and to ajdt. See this bug report.

My solution was to use earlier version of maven-eclipse-plugin, something like 2.4 or 2.5.

Juha Syrjälä
A: 

It could be a relative path issue to reference your other projects.
See this thread

I followed the tip in the above link to include the relativePath in the child module:

<relativePath>../org.reqmon.compiler.POM/pom.xml</relativePath>
VonC
A: 

I am GaryHalcon, had to create new account to post properly.

VonC, that link refers to m2e plugin. I am using the maven eclipse plugin but the issue seems to be similar. Its like workspace resolution isnt working properly or is very erratic.

Using the relativePath tag didn't fix the compile errors I was having either.