Maven dependencies are failing with a 501 error

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

    For all the corporate coders, ideally, if you get this error, it means that your code base is still being built from open-source community. You need to over ride the "central" repository with your in house company Maven repository manager.

    You can go to your settings.xml and override your central repository URL from http:// to https://

    /conf/settings.xml
    

    Find the mirrors sections and add the following entry:

        
         other-mirror
         Other Mirror Repository
         https://other-mirror.repo.other-company.com/maven2
         central
        
    

    In the URL section, if you were using either http://repo1.maven.org/maven2/ or http://repo.maven.apache.org/maven2/ then

    Replace http://repo1.maven.org/maven2/ with https://repo1.maven.org/maven2/

    Replace http://repo.maven.apache.org/maven2/ with https://repo.maven.apache.org/maven2/

    You need to ideally use your company source control management/repository URL over here. As this will block any contact with open source Maven repository community.

    As mentioned in other answers, effective from 15 January 2020, the central Maven repository doesn't support insecure communication over plain HTTP.

提交回复
热议问题