Gradle无法访问https://..pom>对方未经过身份验证 [英] Gradle Could not HEAD https://..pom > peer not authenticated
问题描述
当您从gradle 2.0升级到2.1时,您可能会看到以下错误。
无法HEAD'https://jcenter.bintray.com/de/undercouch/gradle-download-task/1.0/ gradle这个下载任务-1.0.pom。
> peer not authenticated
公平地说,这个错误不是由于gradle造成的。这是java如何处理ssl连接的问题。
我使用下面的java版本。
Java™版本1.7.0_40
Java™SE运行时环境(build 1.7.0_40-b43)
Java HotSpot™64- Bit Server VM(构建24.0-b56,混合模式)
您可以使用 $ b导入安全证书到你的java安装。
我不关心https下载,http对我来说已经足够了。所以看到我的答案。
将您的存储库语法更改为以下其中一项:
<$ p $
jcenter {
urlhttp://jcenter.bintray.com/
}
}
知识库{
maven {
urlhttp://repo1.maven.org/maven2
}
}
警告:请注意,中央Maven 2存储库仅限HTTP不支持
和HTTPS。如果您需要启用公共HTTPS的
中央存储库,则可以使用JCenter公共存储库
(请参见第51.6.3节Maven JCenter存储库)。
我认为maven central用于https。如果我使用以下语法:
存储库{
mavenCentral()
}
$ b
$ b D:\ tools \gradle-2.1-bin\bin\gradle.bat -q
失败:生成失败,出现异常。
-
发生了什么问题:配置根项目'XXXX'时出现问题。
无法解析配置':classpath'的所有依赖关系。
无法解析de.undercouch:gradle-download-task:1.0。
要求:
:XXXX:未指定
不能HEAD' https://repo1.maven.org/maven2/de/undercouch/gradle-download-task/1.0/gradle-download-task-1.0。 POM 。
peer not authenticated
-
尝试:使用--stacktrace选项运行以获取堆栈跟踪。运行--info或--debug选项以获得更多日志输出。
When you upgrade from gradle 2.0 to 2.1, you may see following error.
Could not HEAD 'https://jcenter.bintray.com/de/undercouch/gradle-download-task/1.0/gradle-download-task-1.0.pom'.
> peer not authenticated
To be fair, this error is not due to gradle. It is problem of how java handles ssl connections.
I am using following java version.
java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
You can use following answer to import security certificate your java installation.
I do not care about https downloads, http is enough for me. So see my answer.
解决方案 Change your repository syntax to one of the following
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
repositories {
maven {
url "http://repo1.maven.org/maven2"
}
}
Current (2.1) gradle docs claims that
Warning: Be aware that the central Maven 2 repository is HTTP only
and HTTPS is not supported. If you need a public HTTPS enabled
central repository, you can use the JCenter public repository
(see Section 51.6.3, "Maven JCenter repository").
I think maven central went for https. If I use following syntax.
repositories {
mavenCentral()
}
I get following error.
D:\tools\gradle-2.1-bin\bin\gradle.bat -q
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'XXXX'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve de.undercouch:gradle-download-task:1.0.
Required by:
:XXXX:unspecified
Could not HEAD 'https://repo1.maven.org/maven2/de/undercouch/gradle-download-task/1.0/gradle-download-task-1.0.pom'.
peer not authenticated
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
这篇关于Gradle无法访问https://..pom>对方未经过身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!