Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
468 views
in Technique[技术] by (71.8m points)

Gradle Could not HEAD https://..pom > peer not authenticated

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:oolsgradle-2.1-biningradle.bat -q

FAILURE: Build failed with an exception.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...