Search code examples
groovygroovy-grape

groovy grape grab not using proxy settings


I'm running Groovy v2.4.5 behind a firewall and I have a local cntlm proxy. FYI, when I use grab on open networks, it works.

I've tried running my script this way:

groovy -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 -Divy.message.logger.level=3 try_grape_grab.groovy

And settings those same properties in JAVA_OPTS but groovy doesn't seem to use them, I just see that the download hangs.

export JAVA_OPTS="-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128"

If I use a browser (with proxy settings) I can access the pom that grab is trying to download, so the web proxy is not blocking access to those files either.

Note - I've tried the same with the grape command as well but no luck.

Any ideas?


Solution

  • The comment by andi was the key - I needed to proxy HTTPS also (doh!). It worked once I changed how I ran the script to:

    groovy -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3128 -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 -Divy.message.logger.level=3 try_grape_grab.groovy

    Thanks Andi!