当您从 gradle 2.0 升级到 2.1 时,您可能会看到以下错误。
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连接的问题。
我正在使用以下java版本。
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)
您可以使用以下答案 https://stackoverflow.com/questions/22887829/peer-not-authenticated-while-importing-gradle-project-in-eclipse导入您的java安装的安全证书。
我不关心 https 下载,http 对我来说就足够了。所以看我的回答。
将存储库语法更改为以下之一
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
repositories {
maven {
url "http://repo1.maven.org/maven2"
}
}
当前 (2.1) gradle 文档 http://www.gradle.org/docs/current/userguide/dependency_management.html声称
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。如果我使用以下语法。
repositories {
mavenCentral()
}
我收到以下错误。
D:\tools\gradle-2.1-bin\bin\gradle.bat -q
失败:构建失败并出现异常。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)