Maven dependencies are failing with a 501 error

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

    As stated in other answers, https is now required to make requests to Maven Central, while older versions of Maven use http.

    If you don't want to/cannot upgrade to Maven 3.2.3+, you can do a workaround by adding the following code into your MAVEN_HOME\conf\settings.xml into the section:

    
        maven-https
        
            true
        
        
            
                central
                https://repo1.maven.org/maven2
                
                    false
                
            
        
        
            
                central
                https://repo1.maven.org/maven2
                
                    false
                
            
         
    
    

    This will be always an active setting unless you disable/override it in your POM when needed.

提交回复
热议问题