Behind Proxy

PIP

Run it on command line

set HTTP_PROXY=http://<username>:<password>@<host>:<port>
set HTTPS_PROXY=http://<username>:<password>@<host>:<port>

GRADLE

Edit gradle.properties

systemProp.http.proxyHost=<host>
systemProp.http.proxyPort=<port>
systemProp.http.proxyUser=<username>
systemProp.http.proxyPassword=<password>
systemProp.http.nonProxyHosts=localhost
systemProp.http.keepAlive=true
systemProp.https.proxyHost=<host>
systemProp.https.proxyPort=<port>
systemProp.https.proxyUser=<username>
systemProp.https.proxyPassword=<password>
systemProp.https.nonProxyHosts=localhost
systemProp.https.keepAlive=true

ANT

Change build.xml

  <!-- target: ivy-init ================================================ -->
- <target name="ivy-init" depends="ivy-probe-antlib, ivy-init-antlib" description="--> initialise Ivy settings">
+ <target name="ivy-init" depends="ivy-proxy, ivy-probe-antlib, ivy-init-antlib" description="--> initialise Ivy settings">
   <ivy:settings file="${ivy.dir}/ivysettings.xml" />
  </target>
-
+ <target name="ivy-proxy" description="-->Proxy Ivy settings">
+  <property name="proxy.host" value="host" />
+  <property name="proxy.port" value="port" />
+  <property name="proxy.user" value="username" />
+  <property name="proxy.password" value="password" />
+  <setproxy
+          proxyhost="${proxy.host}"
+          proxyport="${proxy.port}"
+          proxyuser="${proxy.user}"
+          proxypassword="${proxy.password}" />
+ </target>
Advertisements

Leave a Reply

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