Running gradlew (Gradle 1.10) behind NTLM proxy, cannot connect to maven repositories

I see this issue has arisen a couple of times already.

As suggested in some of those discussions, I have a gradle.properties file in my build folder with the proxy settings. I’ve also replaced lib\http-client.jar and lib\http-core.jar with the latest versions from Apache.

If I run gradlew, it correctly downloads the Gradle distribution, which it wouldn’t do until I put a gradle.properties file in the build folder. So the proxy settings appear to be acceptable to Gradle.

The exceptions start when the maven repositories are required. Here’s an example:

Could not resolve org.spockframework:spock-core:0.7-groovy-2.0.

Required by:

:geb-example-gradle:unspecified

Could not GET ‘http://repo1.maven.org/maven2/org/spockframework/spock-core/0.7-groovy-2.0/spock-core-0.7-groovy-2.0.pom’.

org.apache.http.client.ClientProtocolException (no error message)

Here’s the wrapper task from build.gradle, FWIW:

task wrapper(type: Wrapper) {

gradleVersion = ‘1.5’ }

Replacing the Http client jars is not something that would be recommended, or supported. Once you have undone that change, please send the full error message reported by running Gradle with ‘–stacktrace’.

HTTP client/core jars have been reverted.

Stacktrace is here: https://gist.github.com/testingwithfire/8306355

What properties are you setting in your gradle.properties file? Do you have proxy authentication credentials in there, as described in http://www.gradle.org/docs/current/userguide/build_environment.html#sub:ntlm_authentication ?

If so, can you please post the results of running gradle with --debug? (Note this will have a lot of output).

There’s no guarantee I’ll have time to investigate further in the near future, but without more details it’s impossible to help.