Dependency resolution takes huge amount of time

The problem has happened again at work. I have done some debugging work and I have found the problem. It comes from the server. You can simulate the request done by gradle :

curl -v -XHEAD http://owasp-java-html-sanitizer.googlecode.com/svn/maven/org/terracotta/bigmemory/bigmemory/4.0.0/bigmemory-4.0.0.pom

You will see that curl is also stuck. That server response :

HTTP/1.1 404 Not Found
Date: Tue, 14 May 2013 03:11:40 GMT
Server: Apache
Content-Type: text/html; charset=iso-8859-1
Transfer-Encoding: chunked

Basically, only when the request method is HEAD, the server return “Transfer-Encoding: chunked” Which is supposed to mean that the body will be sent in chunk. Except that the server never send the body and so gradle (as well as curl) is stuck, waiting for the body.

I have tested on both Mac and linux and the problem is the same. I don’t have a windows platform to test.

One workaround would be do a GET request instead of HEAD, but I guess it has other consequences…

I have only 3 repositories (mvnCentral excluded) and 2 of them do the same! That’s a real pain!

The outputs of commands used : https://gist.github.com/thibaultdelor/5573497

The stack trace of gradle when stucked : https://gist.github.com/thibaultdelor/5573506

I have no idea why this bug doesn’t happen on all platforms…