Monday, 26 May 2014

Eclipse: Maven m2eclipse shows 'Missing plugin' but JAR file is present and project builds

In my Eclipse Kepler installation, Maven plugin m2eclipse reported a missing dependency artefact, but I could see that the parent project had been built, the JAR in question was visible in my local Maven repository but somehow Eclipse 'couldn't see it'.

I tried a lot of different things to get the problem fixed, but Eclipse also built the project without any errors, so in the end it seemed like some kind of bug or 'feature' in the Maven Eclipse plugin that was causing this.

The solution (for me) turned out to be as follows:

  1. Right click on the project in Eclipse and choose Maven > Disable Maven Nature. This changes the \.settings\org.eclipse.m2e.core.prefs to show resolveWorkspaceProjects=false.
  2. The error disappeared from Eclipse.
  3. Delete the project from Eclipse.
  4. Change the file \.settings\org.eclipse.m2e.core.prefs to show resolveWorkspaceProjects=true.
  5. Import the Maven project again to Eclipse.
I'm still not sure what the actual issue was, but I'm pretty sure that in my case, there was no other way to resolve this one.

I was able to reproduce this same issue in other projects, and the fix above cleared the issue.