'Why does Eclipse take so long to update Maven dependencies?

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?



Solution 1:[1]

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: Preferences ? Maven ? Download 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:[2]

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 3:[3]

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 4:[4]

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 5:[5]

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 6:[6]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 gvlasov
Solution 2 devcodecc
Solution 3 TrueDub
Solution 4 DonQuijote
Solution 5 Pichitron
Solution 6 Kunal Budhiraja