Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gradle build failure Connection to https://repo1.maven.org refused

I am trying to build a sample project that is included in gradle distribution. When I do gradle build I get this error:

Could not resolve commons-collections:commons-collections:3.2.1.
Required by:
    :application:1.0.2
 > Could not HEAD 'https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.pom'.
    > Connection to https://repo1.maven.org refused

I work behind a proxy. I tried the things mentioned here: gradle documentation for proxy configuration but I get the same error. Can you help?

like image 548
dane131 Avatar asked May 29 '15 09:05

dane131


1 Answers

Add gradle.properties file next to the .gradle file with this content :

systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost 

systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost 
like image 109
Lőrincz Péter Avatar answered Oct 30 '22 15:10

Lőrincz Péter