首页 > 其他 > 详细

【Grails 代理Proxy设置】部署Grails遇到Error Resolve error obtaining dependencies:错误,及解决方法

时间:2015-07-01 08:34:41      阅读:404      评论:0      收藏:0      [点我收藏+]

最近在使用Grails,一开始使用3.0.2版本,一直包nullpointer错误,后来使用了2.5.0版本,可以创建工程,但是在进入到工程目录后,再执行grails程序,报错了,步骤如下:

1. grails create-app helloworld // 成功

2. cd helloworld

3. grails        // 出错,信息如下

| Configuring classpath

| Error Resolve error obtaining dependencies: Could not transfer artifact org.grails.plugins:tomcat:zip:7.0.55.2 from/to grailsCentral (https://repo.grails.org/grails/plugins): Connect to repo.grails.org:443 timed out (Use --stacktrace to see the full trace)

字面看是连接不通,后来尝试修改代理地址(我公司需要用代理才可以访问外网),还是失败。

后来发现是需要设置grails的代理才行,如下:

1.  设置命令

grails add-proxy myproxy --host=<server> --port=<port> --username=<username> --password=<password>
grails set-proxy myproxy

2. 打开~/.grails/ProxySettings.groovy,发现内容如下(WIN7平台出错,mac平台正常,大家可以注意一下):

myproxy=[‘http.proxyHost‘:true, ‘http.proxyPort‘:true, ‘http.proxyUser‘:‘‘, ‘http.proxyPassword‘:‘‘, ‘http.nonProxyHosts‘:‘‘]

currentProxy=‘myproxy‘

然后手动修改了host和port,再执行 grails,成功了。

【Grails 代理Proxy设置】部署Grails遇到Error Resolve error obtaining dependencies:错误,及解决方法

原文:http://www.cnblogs.com/xinghebuluo/p/4612202.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!