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?
Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the Download repository index updates on startup option. After changing this setting, restart Eclipse. This triggers the download of the Maven index.
Maven uses HTTP to download its dependencies along with the dependencies of the Maven project (such as Camel). If you run Maven and it fails to download your required dependencies it's likely to be caused by your local firewall & HTTP proxy configurations.
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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With