Gradle Build Error Connection refused to https://repo1.maven.org

I am trying to create a sample project that is included in the 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 for a proxy. I tried the things mentioned here: gradle documentation for setting up a proxy , but I get the same error. You can help?

+4
source share
1 answer

Add the 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 
+8
source

All Articles