Maven dependencies are failing with a 501 error

前端 未结 25 3769
南旧
南旧 2020-11-22 06:28

Recently Maven build jobs running in Jenkins are failing with the below exception saying that they couldn\'t pull dependencies from Maven Central

25条回答
  •  被撕碎了的回忆
    2020-11-22 07:27

    Effective January 15, 2020, The Central Repository no longer supports insecure communication over plain HTTP and requires that all requests to the repository are encrypted over HTTPS.

    If you're receiving this error, then you need to replace all URL references to Maven Central with their canonical HTTPS counterparts.

    (source)

    We have made the following changes in my project's build.gradle:

    Old:

    repositories {
       maven { url "http://repo.maven.apache.org/maven2" }
    }
    

    New:

    repositories {
       maven { url "https://repo.maven.apache.org/maven2" }
    }
    

提交回复
热议问题