Search code examples
javam2eclipsemaven-3

How to force m2eclipse to look for new dependencies after network outage?


we are using m2eclipse 0.12.1 together with nexus oss 1.9.0.1 repository. Today, during a downtime of the nexus server, some user did use "update dependencies" in m2eclipse, which did result in a broken project configuration (artifact not found ... for nearly all dependencies)

The problem is, after the nexus server comes back online, update dependences still did not work, it seems not trying to reach the server. The only brute force sollution which did work was to delete the local repository. Then all dependencies got successfully downloaded.

So, it seems the local metadata went corrupt, or tell m2eclipse not to look on the server again. How to force m2eclipse to download the dependencies? Or how to tell m2eclipse to enable the nexus server again ?


Solution

  • You have to remove all "*.lastUpdated"-files from your local Maven repository.

    On Linux you can use this line to do that:

    find ~/.m2/repository -name "*lastUpdated" -print0 | xargs -0 -r rm
    

    And then use Maven -> Update Dependencies in Eclipse.