【问题标题】:Unable to tunnel through proxy when running Gradle Wrapper in Teamcity在 Teamcity 中运行 Gradle Wrapper 时无法通过代理隧道
【发布时间】:2017-11-21 22:31:09
【问题描述】:

我正在代理后面的 Teamcity 中运行我的 gradle 构建,并且遇到了 Gradle Wrapper 无法下载 Gradle zip 文件的问题。

我已通过 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] [步骤 1/1] 开始: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] [步骤 1/1] 在目录中:/export/home/**/teamcity/work/1ea348ab17354b2f [11:49:21] [步骤 1/1] 下载 https://services.gradle.org/distributions/gradle-4.0-all.zip [11:49:21] [步骤 1/1] [11:49:21] [步骤 1/1] 线程“主”java.io.IOException 中的异常:无法通过代理进行隧道传输。代理返回“需要 HTTP/1.1 407 代理身份验证” [11:49:21] [步骤 1/1] 在 sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2084) [11:49:21] [步骤 1/1] 在 sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183) [11:49:21] [步骤 1/1] 在 sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512) [11:49:21] [步骤 1/1] 在 sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440) [11:49:21] [步骤 1/1] 在 sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) [11:49:21] [步骤 1/1] 在 org.gradle.wrapper.Download.downloadInternal(Download.java:66) [11:49:21] [步骤 1/1] 在 org.gradle.wrapper.Download.download(Download.java:51) [11:49:21] [步骤 1/1] 在 org.gradle.wrapper.Install$1.call(Install.java:62) [11:49:21] [步骤 1/1] 在 org.gradle.wrapper.Install$1.call(Install.java:48) [11:49:21] [步骤 1/1] 在 org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69) [11:49:21] [步骤 1/1] 在 org.gradle.wrapper.Install.createDist(Install.java:48) [11:49:21] [步骤 1/1] 在 org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107) [11:49:21] [步骤 1/1] 在 org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) [11:49:21] [步骤 1/1] 进程以代码 1 退出 [11:49:21] [Step 1/1] Step Gradle 失败

我还尝试了以下设置代理的变体:

-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。还有什么我应该做的吗?

非常感谢您的帮助。

【问题讨论】:

    标签: java gradle proxy teamcity


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-14
      • 2012-08-02
      • 2013-02-11
      • 1970-01-01
      • 1970-01-01
      • 2017-03-04
      • 1970-01-01
      相关资源
      最近更新 更多