Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradlew behind a proxy

Tags:

gradle

gaelyk

People also ask

What does gradlew command do?

gradlew command. The gradlew command, also known as the Gradle wrapper, is a slightly different beast. It's a script that comes packaged up within a project. Yes, it gets committed into version control so when you clone the project you get the gradlew script automatically.

What does gradlew stand for?

gradlew is a wrapper(w - character) that uses gradle . Under the hood gradlew performs three main things: Download and install the correct gradle version. Parse the arguments. Call a gradle task.


All you have to do is to create a file called gradle.properties (with the properties you mentioned above) and place it under your gradle user home directory (which defaults to USER_HOME/.gradle) OR in your project directory.

Gradle (the wrapper too!!!) automatically picks up gradle.properties files if found in the user home directory or project directories.

For more info, read the Gradle user guide, especially at section 12.3: Accessing the web via a proxy


If you need https access behind a proxy, please consider defining also the same set of properties for systemProp.https.

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

See Can't build Android app using crashlytics behind VPN and proxy for more information.


Use this in prompt line:

gradle -Dhttp.proxyHost=***  -Dhttp.proxyPort=*** -Dhttp.proxyUser=**** -Dhttp.proxyPassword=****

Works here!


Add the below in your gradle.properties file and in your gradle/wrapper/gradle-wrapper.properties file if you are downloading the wrapper over a proxy

If you want to set these properties globally then add it in USER_HOME/.gradle/gradle.properties file

## Proxy setup
systemProp.proxySet=true
systemProp.http.keepAlive=true
systemProp.http.proxyHost=host
systemProp.http.proxyPort=port
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=local.net|some.host.com

systemProp.https.keepAlive=true
systemProp.https.proxyHost=host
systemProp.https.proxyPort=port
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=local.net|some.host.com
## end of proxy setup