Configuring Gradle behind a Proxy

If you are working with Gradle behind a proxy, you will need to configure Gradle with proxy information so it can download dependencies.

Note: If you haven’t installed Gradle yet, read my post.

In your user directory (e.g. c:\users\steve or /users/steve), open the .gradle folder (you may need to enable hidden folders on your file browser). open the gradle.properties file. If it does not exist, create it.

Add the following lines with the values replaced with the values specific to your proxy:

systemProp.http.proxyHost=www.proxyhost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost

Hope that helps someone!

References
Gradle – Build Environment

Posted in Gradle Tagged with:
  • Jean Lestang

    Hi.
    I had troubles using Crashlytics behind a proxy, as it uses port 443.
    In this case please considered defining the same parameters also for http*s*:

    systemProp.https.proxyHost=www.proxyhost.org
    systemProp.https.proxyPort=8080

    Regards, Jean.

Sponsored

Follow Me

RSS FeedFollow me on Twitter