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

后端 未结 4 923
孤独总比滥情好
孤独总比滥情好 2020-12-01 06:19

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/gr         


        
4条回答
  •  孤街浪徒
    2020-12-01 06:58

    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.

提交回复
热议问题