[英]grails 3.0.1 proxy settings
我是Grails 3.0.1的新手,并想知道如何以及在何处设置正确的代理设置。 我知道我的代理配置是什么 - IP和端口,但不知道放在哪里。 当我在helloworld项目中尝试运行grails命令时,我收到类似这样的错误:
ivo@ivotrisquel:~/grails/projects/helloworld$ grails --stacktrace
| Error Problem updating profiles from origin git repository (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.eclipse.jgit.api.errors.TransportException: https://github.com/grails/grails-profile-repository: cannot open git-upload-pack
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
at org.grails.cli.profile.git.GitProfileRepository.fetchAndRebaseIfExpired(GitProfileRepository.groovy:140)
at org.grails.cli.profile.git.GitProfileRepository.createOrUpdateRepository(GitProfileRepository.groovy:109)
at org.grails.cli.profile.git.GitProfileRepository.getProfile(GitProfileRepository.groovy:56)
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:347)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:192)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:99)
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/grails/grails-profile-repository: cannot open git-upload-pack
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:524)
at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:309)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1115)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
... 6 more
Caused by: java.net.ConnectException: Connection timed out github.com
at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:175)
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:475)
... 11 more
| Error Problem updating profiles from origin git repository
我有同样的问题并解决了它以下列方式将代理配置添加到GRAILS_HOME / bin / grails.bat文件:
>set GRAILS_OPTS=%GRAILS_OPTS% -Dhttp.proxyHost=myProxy -Dhttp.proxyPort=myPort -Dhttps.proxyHost=myProxy -Dhttps.proxyPort=myPort -Dhttp.proxyUser=bob -Dhttp.proxyPassword=theBuilder
我相信在Grails 3.0.x中必须有另一种方法来配置代理,但到目前为止我还没有找到它。
问候
在linux中添加配置
export GRAILS_OPTS="-Dhttp.proxyHost=myProxy -Dhttp.proxyPort=myPort -Dhttps.proxyHost=myProxy -Dhttps.proxyPort=myPort"
在GRAILS_HOME / bin / grails.sh文件中。 解决我在Netbeans 8.1中的问题
对于GRAILS3,现在有足够的文档来说明如何设置代理。
正如@campos所说,在Windows中你必须这样做
set GRAILS_OPTS=-Dhttp.proxyHost=myProxy -Dhttp.proxyPort=myPort -Dhttps.proxyHost=myProxy -Dhttps.proxyPort=myPort
但这只能纠正一半,因为你还需要纠正gradle引擎,插入gradle.properties值如下
systemProp.http.proxyHost=proxy.yourdomain.com
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=yourpass
systemProp.http.nonProxyHosts=localhost
有完整的解释在这里和这里的gradle产出 。 有了我在Windows10上的所有功能,我可以在公司代理后面正确编译和构建软件包。
我在以下~/.grails/ProxySettings.groovy
文件中添加了以下内容。
client=['http.proxyHost':'myproxy', 'http.proxyPort':'myport', 'http.proxyUser':'myusername', 'http.proxyPassword':'mypass', 'http.nonProxyHosts':'localhost']
currentProxy='client'
经过长时间的奋斗,我找到了适用于Windows环境的解决方案。以下对我有用
设置GRAILS_OPTS = -Dhttp.proxyHost = myProxy -Dhttp.proxyPort = myPort -Dhttps.proxyHost = myProxy -Dhttps.proxyPort = myPort -Dhttp.proxyUser = bob -Dhttp.proxyPassword = theBuilder
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.