There are 2 ways for using Gradle behind a proxy :
(From Guillaume Berche's post)
Add these arguments in your gradle command :
-Dhttp.proxyHost=your_proxy_http_host -Dhttp.proxyPort=your_proxy_http_port
or these arguments if you are using https :
-Dhttps.proxyHost=your_proxy_https_host -Dhttps.proxyPort=your_proxy_https_port
in gradle.properties
add the following lines :
systemProp.http.proxyHost=your_proxy_http_host
systemProp.http.proxyPort=your_proxy_http_port
systemProp.https.proxyHost=your_proxy_https_host
systemProp.https.proxyPort=your_proxy_https_port
(for gradle.properties
file location, please refer to official documentation https://docs.gradle.org/current/userguide/build_environment.html
EDIT : as said by @Joost :
A small but important detail that I initially overlooked: notice that the actual host name does NOT contain http://
protocol part of the URL...