Gradle proxy settings

If you are behind the corporate proxy, you can configure Gradle to use the proxy by following settings.

Create a file called ~/.gradle/gradle.properties

Generally is in «USER_HOME»/.gradle/gradle.properties, where «USER_HOME» is your home directory.
That’s typically one of the following, depending on your platform:
C:\Users\<username> (Windows Vista & 7+)
/Users/<username> (macOS)
/home/<username> (Linux)

Add the settings related to proxy.

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

Also add the HTTPS proxy settings

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

If your proxy is a CNTLM then you can also configure

* Set the http.proxyUser system property to a value like domain/username.
• Provide the authentication domain via the http.auth.ntlm.domain system property.