views:

169

answers:

2

Hi,

I'm a bit disappointed by what is happening to me. I'm not a maven expert (ie I just type mvn clean install as I was told) but as I installed a new kernel on my debian machine, it seems maven doesnt work anymore :

on old kernel (2.6.26-1-amd64) it download all dependencies well.

on new kernel (2.6.32-trunk-amd64) it fail downloading dependencies with a "network unreachable" message :

[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/objectweb/fractal/parent/2.0/parent-2.0.pom
[WARNING] Unable to get resource 'org.objectweb.fractal:parent:pom:2.0' from repository central (http://repo1.maven.org/maven2): Error transferring file: Network is unreachable
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: null:cecilia:pom:2.2-SNAPSHOT

Reason: Cannot find parent: org.objectweb.fractal:parent for project: null:cecilia:pom:2.2-SNAPSHOT for project null:cecilia:pom:2.2-SNAPSHOT

of course, the network seems totally reachable as this is the problem regarding network I got.

mvn --version
2.2.1

Any help would be great! Thx

+7  A: 

This sounds like bug #563946 (which is actually caused by a JVM bug). The suggested workaround is to set the following system property when running maven (and other Java programs):

-Djava.net.preferIPv4Stack=true

If this works, then you can set it in the MAVEN_OPTS environment variable (e.g. in "~/.mavenrc"):

MAVEN_OPTS="-Djava.net.preferIPv4Stack=true"
Pascal Thivent
nice! i was posting didn't saw your answer, thought the -D solution was more painfull than editing the system conf, but it also work! and in fact your solution is better because java/maven specific! thanks
claferri
also, i think #563946 is a dup from #560056 :)
claferri
@claferri Yes it is a dup, the cause is reported in #560056 as you mentioned (and the JVM bug is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6342561).
Pascal Thivent
@Pascal Thivent +1 for you .. I don't know how many years have you had experience with maven, but you seem to have all the answers out there
c0mrade
@c0mrade To answer your question, I started with Maven 0.8 in early 2003 so I'm kinda familiar with this animal indeed. But this answer was more google fu to be honest, my head still doesn't crawl the web ;)
Pascal Thivent
+3  A: 

In fact a friend of mine find out where this came from, it's a java bug :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560056

so simply editing /etc/sysctl.d/bindv6only.conf

#net.ipv6.bindv6only = 1
# Set to 0 due to java but (#560056)
net.ipv6.bindv6only = 0

should do the trick!

claferri
This solution affect the whole system, while Pascal' solution is java/maven specific and thus is better!
claferri