Why does Eclipse take so long to update Maven dependencies?

EclipseMaven

Eclipse Problem Overview


I have a Maven project in my Eclipse workspace. When I start Eclipse, it takes a very long time to update Maven dependencies. It actually seems like it will never finish and while it is doing this update, I can't do anything in Eclipse.

Can anybody help me?

Eclipse Solutions


Solution 1 - Eclipse

If this happens on eclipse start, it is maybe not the dependecy update of your project but the Maven repository index update (as khmarbaise mentioned in his comment).

You can disable this here: PreferencesMavenDownload repository index updates on startup

A fresh index offers you an up to date list of dependencies, e.g. in the Add Dependency dialog. But I found it will do if the index is updated manually (as needed) in the Maven Repositories View.

Update: Since Eclipse Luna the index update is now disabled by default (see Bug404417).

Solution 2 - Eclipse

First check all of your dependencies including plugins and children in the dependency tree,
try to replace snapshot versions with release versions,
as snapshot versions will always look for a later update, whereas
release versions are deemed to be stable and updates are not expected for the same version number.

Secondly, assuming that you are working on a LAN, I would suggest that you install a local maven repository manager such as Nexus, and then redirect your artifact requests by setting
<mirrorOf>*</mirrorOf> in your ${user.home}/.m2/settings.xml

This will enable your downloads to be resolved quickly against a local mirror, rather than continually checking against repositories on the internet.

Solution 3 - Eclipse

Even i was facing updating maven dependencies on eclipse startup and eclipse hangup. I found that my workspace directory do not have required permission(full permission). After i set those permission my issue got resolved.

Solution 4 - Eclipse

Have you set Eclipse to use the local copy of Maven, rather than the built-in one? I've found that to be quicker. Also, make sure Eclipse is pointing to the local copy of your config file.

Solution 5 - Eclipse

If it still takes a long time after trying all the other options, create a new workspace and move your projects to the new workspace.

Solution 6 - Eclipse

If you use a proxy for connect, check in your settings.xml (D:\apache-maven-3.3.3\conf) if you have set correctly the user/password.

<proxies>
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>XXXX</username>
      <password>XXXX</password>
      <host>XXXX</host>
      <port>8080</port>
      <nonProxyHosts>XXXX</nonProxyHosts>
    </proxy>  
 </proxies>

Solution 7 - Eclipse

I have faced the same issue but I was using the sts. I tried to replace the snapshot versions with release versions and even also I changed the embedded maven of sts to my system installed but did not found any luck. I have updated my sts to the latest and boom it is no longer taking an infinite time to download

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTomView Question on Stackoverflow
Solution 1 - EclipseFrVaBeView Answer on Stackoverflow
Solution 2 - EclipsecrowneView Answer on Stackoverflow
Solution 3 - EclipsedevcodeccView Answer on Stackoverflow
Solution 4 - EclipseTrueDubView Answer on Stackoverflow
Solution 5 - EclipseHrishi JimageView Answer on Stackoverflow
Solution 6 - EclipsePichitronView Answer on Stackoverflow
Solution 7 - EclipseKunal BudhirajaView Answer on Stackoverflow