2017-06-19 60 views
0

我在Teamcity中运行我的gradle内部代理,并面临Gradle Wrapper无法下载Gradle zip文件的问题。在Teamcity中运行Gradle包装器时无法通过代理进行隧道

我已经通过gradle参数向Gradle命令添加了代理设置。

/export/home/**/teamcity/work/1ea348ab17354b2f/gradlew --init-script /export/home/**/teamcity/plugins/gradle-runner/scripts/init.gradle -Djdk.http.auth.tunneling.disabledSchemes=”” -Djdk.http.auth.proxying.disabledSchemes=”” -Dhttp.proxyHost=***.com -Dhttp.proxyPort=3128 -Dhttp.proxyUser=** -Dhttp.proxyPassword=** -Dorg.gradle.daemon=false -d -b build.gradle bootRepackage 

这里是例外,我得到:

 
[11:49:21] [Step 1/1] Starting: bash /export/home/**/teamcity/work/1ea348ab17354b2f/gradlew --init-script /export/home/**/teamcity/plugins/gradle-runner/scripts/init.gradle -Djdk.http.auth.tunneling.disabledSchemes=”” -Djdk.http.auth.proxying.disabledSchemes=”” -Dhttp.proxyHost=***.com -Dhttp.proxyPort=3128 -Dhttp.proxyUser=** -Dhttp.proxyPassword=** -Dorg.gradle.daemon=false -d -b build.gradle bootRepackage 
[11:49:21] [Step 1/1] in directory: /export/home/**/teamcity/work/1ea348ab17354b2f 
[11:49:21] [Step 1/1] Downloading https://services.gradle.org/distributions/gradle-4.0-all.zip 
[11:49:21] [Step 1/1] 
[11:49:21] [Step 1/1] Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required" 
[11:49:21] [Step 1/1] at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2084) 
[11:49:21] [Step 1/1] at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183) 
[11:49:21] [Step 1/1] at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512) 
[11:49:21] [Step 1/1] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440) 
[11:49:21] [Step 1/1] at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) 
[11:49:21] [Step 1/1] at org.gradle.wrapper.Download.downloadInternal(Download.java:66) 
[11:49:21] [Step 1/1] at org.gradle.wrapper.Download.download(Download.java:51) 
[11:49:21] [Step 1/1] at org.gradle.wrapper.Install$1.call(Install.java:62) 
[11:49:21] [Step 1/1] at org.gradle.wrapper.Install$1.call(Install.java:48) 
[11:49:21] [Step 1/1] at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69) 
[11:49:21] [Step 1/1] at org.gradle.wrapper.Install.createDist(Install.java:48) 
[11:49:21] [Step 1/1] at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107) 
[11:49:21] [Step 1/1] at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) 
[11:49:21] [Step 1/1] Process exited with code 1 
[11:49:21] [Step 1/1] Step Gradle failed

我自己也尝试设置代理的以下变化:

-Dhttps.proxyHost= 
-Dhttps.proxyPort= 
-Dhttps.proxyUser= 
-Dhttps.proxyPassword= 

-DsystemProp.http.proxyHost= 
-DsystemProp.http.proxyPort= 
-DsystemProp.http.proxyUser= 
-DsystemProp.http.proxyPassword= 

-DsystemProp.https.proxyHost= 
-DsystemProp.https.proxyPort= 
-DsystemProp.https.proxyUser= 
-DsystemProp.https.proxyPassword= 

,并尝试此处禁止用于基本身份验证隧道:

-Djdk.http.auth.tunneling.disabledSchemes=”” 
-Djdk.http.auth.proxying.disabledSchemes=”” 

这些选项在Teamcity中似乎都不起作用。还有什么我应该做的?

非常感谢您的帮助。

回答

0

事实证明,teamcity运行构建的主机/代理并未连接到互联网。另一个代理是,能够很好地下载gradle安装,并运行完整版本。