Maven dependencies are failing with a 501 error

前端 未结 25 3226
南旧
南旧 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:28

    The error:

    Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh/2.1/wagon-ssh-2.1.pom.

    Return code is: 501 , ReasonPhrase:HTTPS Required.

    Root cause analysis:

    Maven central is expecting that the clients use https, but the client is making plain HTTP request only.

    Therefore, the request for downloading the package named 'wagon-ssh-2.1.pom' had failed.

    How to fix the problem?

    Replace the URL "http://repo.maven.apache.org/maven2"

    with "https://repo.maven.apache.org/maven2"

    in pom.xml file or build.gradle file of the project.

提交回复
热议问题