簡體   English   中英

grails 3.0.1代理設置

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM