Gradle 无法 HEAD https://..pom >对等体未通过身份验证 [英] Gradle Could not HEAD https://..pom > peer not authenticated
问题描述
当您从 gradle 2.0 升级到 2.1 时,您可能会看到以下错误.
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
公平地说,这个错误不是由于 gradle.是java如何处理ssl连接的问题.
To be fair, this error is not due to gradle. It is problem of how java handles ssl connections.
我正在使用以下 Java 版本.
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)
您可以使用以下答案导入安全证书您的 java 安装.
You can use following answer to import security certificate your java installation.
我不在乎 https 下载,http 对我来说已经足够了.所以看我的回答.
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"
}
}
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").
我认为 maven central 选择了 https.如果我使用以下语法.
I think maven central went for https. If I use following syntax.
repositories {
mavenCentral()
}
出现以下错误.
D: oolsgradle-2.1-biningradle.bat -q
D: oolsgradle-2.1-biningradle.bat -q
FAILURE:构建失败,出现异常.
FAILURE: Build failed with an exception.
出了什么问题:配置根项目XXXX"时出现问题.
What went wrong: A problem occurred configuring root project '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'.未通过身份验证的对等方
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
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪.使用 --info 或 --debug 选项运行以获得更多日志输出.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
这篇关于Gradle 无法 HEAD https://..pom >对等体未通过身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!