Search code examples
grailsgrails-plugin

grails behind a proxy / redirected to https


I got an grails application created behind a proxy a few month ago (all worked fine i.e. the initial load of all dependencys via the proxy). Now I want to add some new plugins to it, and some other people should also bring the app up and running on their maschines.

So the ProxySetting in grails (ProxySettings.groovy) is:

client=['http.proxyHost':"1.2.3.4", 'http.proxyPort':"8080",
        'http.proxyUser':'', 'http.proxyPassword':'', 'http.nonProxyHosts':'']
currentProxy='myproxy'

But: when I try to enhance the app by for example

compile ":jasper:1.11.0"

I get an error:

   ==== grailsCentral: tried
      http://grails.org/plugins/grails-jasper/tags/RELEASE_1.11.0/jasper-1.11.0.pom
      -- artifact org.grails.plugins#jasper;1.11.0!jasper.zip:
      http://grails.org/plugins/grails-jasper/tags/RELEASE_1.11.0/grails-jasper-1.11.0.zip


            ::::::::::::::::::::::::::::::::::::::::::::::
            ::          UNRESOLVED DEPENDENCIES         ::
            ::::::::::::::::::::::::::::::::::::::::::::::
            :: org.grails.plugins#jasper;1.11.0: not found
            ::::::::::::::::::::::::::::::::::::::::::::::

I figured out, that when I try to get the pom or zip file from that URL by

wget http://grails.org/plugins/grails-jasper/tags/RELEASE_1.11.0/grails-jasper-1.11.0.zip

--2015-03-12 11:24:27--  http://grails.org/plugins/grails-jasper/tags/RELEASE_1.11.0/grails-jasper-1.11.0.zip
Connecting to 1.2.3.4:8080... connected.
Proxy request sent, awaiting response... 302 Found
Location: https://repo.grails.org/grails/plugins-releases-local/org/grails/plugins/jasper/1.11.0/jasper-1.11.0.zip [following]

It is redirected to https!

So in wget this is only working when I export https_proxy=http://1.2.3.4:8080

So I try to configure it in ProxySettings.groovy like this:

myproxy=['https.proxyHost':'10.206.247.65', 'https.proxyPort':'8080', 
'http.proxyHost':'10.206.247.65', 'http.proxyPort':'8080']

but that doesn't help. Is there any way to tell grails to use the proxy also for https connections or any other way to fix this?


Solution

  • We had a similar problem and changed the grailsPlugins() entry in BuildConfig, under repositories{} to mavenRepo "http://repo.grails.org/grails/plugins"

    I'm not sure if this is the best long-term solution, but it did stop Grails from trying to find plugins over https.