gpt4 book ai didi

gradle - Gradle无法通过代理从HTTPS下载插件

转载 作者:行者123 更新时间:2023-12-03 05:12:36 24 4
gpt4 key购买 nike

我一直在努力获取下载一个来自HTTPS URL的插件的机会,并且无法终生弄清自己在做什么错。根据我在互联网上阅读的内容,通常可以通过设置一个代理(我拥有的代理)来解决此问题,并且在调试日志中,gradle似乎正在使用它。我还尝试过手动将调试日志中所有URL列出的证书添加到我的cacerts文件中,但无济于事。

调试日志-从gradle为springboot插件执行的最后一次重定向开始-如下所示:

Redirecting to 'https://jcenter.bintray.com/org/springframework/boot/spring-boot-tools/1.4.3.RELEASE/spring-boot-tools-1.4.3.RELEASE.pom' via {tls}->http://myProxy:2020->https://jcenter.bintray.com:443
can be kept alive indefinitely
Connection released: [id: 204][route: {tls}->http://myProxy:2020->https://plugins.gradle.org:443][total kept alive: 2; route allocated: 1 of 2; total allocated: 2 of 20]
CookieSpec selected: default
Auth cache not set in the context
Connection request: [route: {tls}->http://myProxy:2020->https://jcenter.bintray.com:443][total kept alive: 2; route allocated: 0 of 2; total allocated: 2 of 20]
Connection leased: [id: 206][route: {tls}->http://myProxy:2020->https://jcenter.bintray.com:443][total kept alive: 2; route allocated: 1 of 2; total allocated: 3 of 20]
Opening connection {tls}->http://myProxy:2020->https://jcenter.bintray.com:443
Connecting to myProxy/myProxyIp:2020
Connection established myIp:64916<->myProxyIp:2020
Tunnel to target created.
Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2]
Enabled cipher suites:[Removed for readability]
Starting handshake
http-outgoing-206: Shutdown connection
Connection discarded
http-outgoing-206: Close connection
Connection released: [id: 206][route: {tls}->http://myProxy:2020->https://jcenter.bintray.com:443][total kept alive: 2; route allocated: 0 of 2; total allocated: 2 of 20]
Flushing resolved configuration data in Binary store in C:\Temp\gradle7433380394459999850.bin. Wrote root 2.
Timing: Running the build script took 1.082 secs

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'TutorialHelloWorld'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.3.RELEASE.
Required by:
project :
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.3.RELEASE.
> Could not parse POM https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-gradle-plugin/1.4.3.RELEASE/spring-boot-gradle-plugin-1.4.3.RELEASE.pom
> Could not resolve org.springframework.boot:spring-boot-tools:1.4.3.RELEASE.
> Could not resolve org.springframework.boot:spring-boot-tools:1.4.3.RELEASE.
> Could not get resource 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-tools/1.4.3.RELEASE/spring-boot-tools-1.4.3.RELEASE.pom'.
> Could not GET 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-tools/1.4.3.RELEASE/spring-boot-tools-1.4.3.RELEASE.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
Run with --stacktrace option to get the stack trace.

BUILD FAILED

我可以通过浏览器下载该文件,该浏览器也使用代理,因此应该可以。这是与Java 1.8.0_71-b15和gradle 3.4一起使用的。

我还从没有代理服务器(也没有为gradle配置代理服务器)的网络上的同一台计算机上尝试了相同的命令,并最终出现了相同的错误,因此这似乎是我的环境而不是代理服务器。

任何想法可能在这里发生什么?

最佳答案

我没有根,这帮助了我

export JAVA_TOOL_OPTIONS+="-Djava.net.useSystemProxies=true -Djavax.net.ssl.trustStore=$HOME/jks/cacerts"
keytool -import -alias root_ca -trustcacerts -keystore $HOME/jks/cacerts -file /tmp/root-ca.pem
keytool -import -alias sub_ca -trustcacerts -keystore $HOME/jks/cacerts -file /tmp/sub-ca.pem

关于gradle - Gradle无法通过代理从HTTPS下载插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42449302/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com