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

最近在使用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,成功了。

转载于:https://www.cnblogs.com/xinghebuluo/p/4612202.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值