几个月前,我在代理后面创建了一个grails应用程序(一切正常,即通过代理的所有依赖项的初始加载)。
现在,我想向其中添加一些新插件,其他一些人也应该在自己的机器上启动并运行该应用程序。
因此,grails(ProxySettings.groovy)中的ProxySetting是:
client=['http.proxyHost':"1.2.3.4", 'http.proxyPort':"8080",
'http.proxyUser':'', 'http.proxyPassword':'', 'http.nonProxyHosts':'']
currentProxy='myproxy'
但是:例如,当我尝试通过以下方式增强应用程序时
compile ":jasper:1.11.0"
我收到一个错误:
==== 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
::::::::::::::::::::::::::::::::::::::::::::::
我发现,当我尝试从该URL获取pom或zip文件时,
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]
它被重定向到https!
所以在wget中这仅在我
export https_proxy=http://1.2.3.4:8080
时有效所以我尝试像这样在ProxySettings.groovy中配置它:
myproxy=['https.proxyHost':'10.206.247.65', 'https.proxyPort':'8080',
'http.proxyHost':'10.206.247.65', 'http.proxyPort':'8080']
但这无济于事。
有没有办法告诉grails将代理也用于https连接或任何其他方式来解决此问题?
最佳答案
我们遇到了类似的问题,并将BuildConfig中grailsPlugins()
下的repositories{}
条目更改为mavenRepo "http://repo.grails.org/grails/plugins"
我不确定这是否是最佳的长期解决方案,但确实阻止了Grails尝试通过https查找插件。
关于grails - 在代理后面滚动/重定向到https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29007779/