Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compiling with maven and nexus stuck on downloading artifacts

Tags:

maven

build

nexus

we are using here nexus 1.9.2.4 and maven 2.2.1 and on one pc (and only that one) when we try to compile our code using maven, it get stuck on downloading jars. for example it'll be stuck on:

Downloading: http://mainserver:8081/nexus/content/groups/public/org/codehaus/mojo/javascript/javascript-maven-plugin/1.0-alpha-1-SNAPSHOT/javascript-maven-plugin-1.0-alpha-1-20090530.211438-7.jar 17/54K

and won't continue at all. tried using maven 3.0.4, but with the same result.

the machine runs windows 7.

any advise will be appreciated

like image 653
Aviad S. Avatar asked Feb 13 '12 09:02

Aviad S.


2 Answers

This appears to be a bug related to using Maven on Java 7 and 64bit Windows. I have been experiencing similar problems.

The maven bug report and some discussion can be found here:

http://jira.codehaus.org/browse/MNG-5162

Workaround documented here:

https://cwiki.apache.org/confluence/display/MAVEN/ConnectException

Add -Djava.net.preferIPv4Stack=true to MAVEN_OPTS

like image 113
lexicalscope Avatar answered Oct 22 '22 03:10

lexicalscope


Maven really needs to have some kind of support for mirrors and failsafes for the qurkeyness of the internet. Really, not everyone is going to be able to have a peered connection with the Oracle and Apache repositories. Every internet connection is going to drop a packet here and there, the "get a new ISP" response from Maven fans wouldn't help even if it were an option.

I've been staring at a 400k download go nowhere for about 10 minutes. I've noticed it gets stuck on the same files every time I wipe my repo too (bad sector maybe?). Which is a complete pita since it doesn't seem I can specify mirrors for it (short of hacking a hosts file). If you're a Maven project leader, look to Aptitude for ideas on what Maven could be.

EDIT: I found a solution to my Maven problem here.

https://jira.codehaus.org/browse/MNG-5162

Under Ubuntu 13.10 simply...

sudo gedit /etc/environment

Add

MAVEN_OPTS="-Djava.net.preferIPv4Stack=true"

Save

Close

Reload terminal.

like image 21
Trae Barlow Avatar answered Oct 22 '22 02:10

Trae Barlow