Posts Tagged ‘Proxy Config’

Proxy Management for Gradle, Eclipse and Grails…

March 19, 2014 1 comment

This is an ever thorny subject and scope for much pain for users including myself

So thought i’d catalog the best way to set this up when working behind a firewall

starting with

Best way for gradle is to add file into into the root of your project or into into USER_HOME/.gradle (user wide config)

basic attributes you may need to set are

then refresh the dependencies (say from within your eclipse build with Gradle project support enabled)

Grails Projects

For Grails projects (v2 onwards) you can creat a ProxySettings.groovy file in the “${userHome}/.grails/scripts/ProxyConfig.groovy” directory and refresh the grails dependencies (note: this is global to all projects) where the file format is like this

MyProxy=['http.proxyHost':'xx.xx.xx.xx', 'http.proxyPort':'8080', 'http.proxyUser':'', 'http.proxyPassword':'', 'http.nonProxyHosts':'my_maven_server']

alternatively you are supposed to be able run the following commands on grails

grails add-proxy proxyConf –host=proxy-server –port=4300
–username=guest –password=guest
grails set-proxy proxyConf

though i’m not certain that i have had this work in call cases but adding the file seems to.

lastly if that doesn’t work – you can try and edit your projects /conf/BuildConfig.groovy and add the following to that file[
   "http.proxyHost": "",
    "http.proxyPort": "8080",
    "http.proxyUserName": "myUser",
    "http.proxyPassword": "myPass"

Eclipse itself

best i have found Eclipse itself is to add the proxy in the eclipse.ini file (or GGTS.ini etc ) with your eclipse build

you need to be careful – there can be no spaces round the definition else Eclipse doesn’t seem to read it correctly

You need to specify the following options below the -vmargs option in the .ini file, each on a separate line and spare whitespace at the end etc

and if this doesnt work you can try adding

and try again.

Good luck

%d bloggers like this: