您的位置:首页 > 大数据 > 人工智能

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

2015-07-01 01:18 633 查看
最近在使用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,成功了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: