Reputation: 11
I am trying to build a project using maven (mvn). As you might know (for people who used mvn before), if the project is missing any dependencies to build, mvn first downloads these dependencies from somewhere (central repositories, I guess). My problem is that on Windows 7, mvn hangs during this download phase non-deterministically and often. Yesterday, I have waited for 10 hours to download a dependency as small as 300-400 kbs. Does anybody know how to fix this or what is the reason?
Thanks,
Upvotes: 1
Views: 2489
Reputation: 8668
Setting MAVEN_OPTS
to -Djava.net.preferIPv4Stack=true
fixed this problem for me (This option disables IPv6 and uses AF_INET sockets exclusively).
I found this solution as an answer to the Maven stuck on downloading dependencies when using java 7 issue on http://jira.codehaus.org.
See also
[ Ack: thanks @ David Hartveld for more info on this issue. ]
Upvotes: 5
Reputation: 21
If you are running AVG, try disabling it.
http://comments.gmane.org/gmane.comp.jakarta.turbine.maven.user/122046
Upvotes: 2
Reputation: 481
I don't have an answer for this but I disagree with the previous comment. I was having the same problem. For some dependencies, I was able to finish the download after several retries. It doesn't seem like a networking error on my end would cause these symptoms. I suspect that the mirror is overloaded. I had success on the remaining dependencies by switching to European mirrors. I tried going East from my location since it's now the middle of the night there.
Upvotes: 0
Reputation: 128909
Resolve your networking issues. If the downloads are failing/hanging, it's not anything inside Maven. When it downloads artifacts, it shows you the URLs being downloaded. You can use these URLs to troubleshoot your problems. Try them in a browser, from wget
, or whatever.
Upvotes: -1