Eclipse does not recognize existing resolved Maven dependencies

24,361

Solution 1

I removed check from "Do not automatically update dependencies from remote repositories" option and that made the trick.

Solution 2

Eclipse produces quite a lot of problems when it comes to M2. What I do to get rid of this problems is to clean the project(Project > Clean...), use an external maven (Window > Preferences > Installations > ...) for building purposes and from the maven settings of a project I Update Project configuration (Right click on the project > Maven > Update project ...).

Hope this helps.

Solution 3

Eclipse will sometimes need a kick like user503413 says (and a restart), but sometimes it's also right: make sure that in $HOME/.m2/repository/ you indeed have the dependencies you want (that's where maven, and therefore m2eclipse through maven) will put them. If they are there, make sure the pom makes sense. Fix if needed, and... then clean up and restart eclipse just in case ;)

Share:
24,361
mico
Author by

mico

Web | Mobile | IoT | Networking | Machine Learning

Updated on April 20, 2020

Comments

  • mico
    mico about 4 years

    I have m2 plugin in Ecplipse 3.8.0 and a project that has maven dependencies inside. Local .m2 folder has the correct version of the dependency, pom.xml looks correctly but Dependencies tab when opening the pom.xml in Eclipse tells "Failed to read artifact descriptor.." error. Also I get missing artifact error on the Problems section on Eclipse.

    Where does the m2-plugin or Eclipse read those dependencies, if they show up correctly on pom.xml and the correcponding jar is at .m2 folder?

  • mico
    mico over 11 years
    I removed check from "Do not automatically update dependencies from remote repositories" option and that made the trick. Was this the tap you meant?
  • Olimpiu POP
    Olimpiu POP over 11 years
    Glad to hear that you found a solution. Not exactly sure I know what tap you refer to, though.
  • mico
    mico over 11 years
    Thanks @user503413 about pointing me on correct direction when answering about check for settings. My +1 came for that.
  • ishanbakshi
    ishanbakshi about 8 years
    I did all this, didn't work, but then i closed the project(right click on project >> close project) in eclipse and opened it back again and it worked. Seems like an eclipse bug.
  • dustytrash
    dustytrash about 3 years
    Where is that option?
  • mico
    mico about 3 years
    Window -> Preferences -> Maven -> Do not automatically update dependencies from remote repositories