Proxy configuration for Gradle

6 05 2017

Are you using gradle behind corporate proxy? Here is how to configure proxy data for gradle (urls and credentials)

gradle.properties file

Gradle (and gradlew as well) is automatically reading gradle.properties file that is either in project directory or in USER_HOME/.gradle directory.

Inside of gradle.properties file set properties:

systemProp.http.proxyHost=http_proxy_ip_or_url
systemProp.http.proxyPort=port
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=pwd
systemProp.https.proxyHost=https_proxy_ip_or_url
systemProp.https.proxyPort=port
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password

The configuration above concerns both http and https traffic.

Inline properties

As an alternative you can specify properties in each gradle command by:

gradle build -Dhttp.proxyHost=http_proxy_ip_or_url ...
Advertisements

Actions

Information

Give Your feedback:

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: