gradleproxybuild.gradlegradle-dependenciesgradle-properties

How can I download gradle depedencies with proxy and without proxy


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


Solution

  • 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>