How can I download gradle depedencies with proxy and without proxy

258 Views Asked by At

I have a build.gradle and I download some dependencies with proxy, but there are some dependencies which give 403 forbidden error and will work without proxy. How Can this be possible that gradle build knows when to use proxy and when not

1

There are 1 best solutions below

0
On BEST ANSWER

I resolved this by adding nonProxyhosts in gradle.properties file. Along with other Proxyhosts

systemProp.http.proxyHost=<proxy host>
systemProp.http.proxyPort=<proxy port>
systemProp.http.nonProxyHosts=<url of the host>
systemProp.https.proxyHost=<proxy host>
systemProp.https.proxyPort=<proxy port>
systemProp.https.nonProxyHosts=<url of the host>