jenkins自动编译Maven项目_记一次编译失败501error


Failed to transfer Could not transfer artifact org.springframework.cloud:spring-cloud-dependencies-parent:pom:2.1.3.RELEASE from/to central (http://repo.maven.apache.org/maven2): 
Failed to transfer file: http://repo.maven.apache.org/maven2/org/springframework/cloud/spring-cloud-dependencies-parent/2.1.3.RELEASE/spring-cloud-dependencies-parent-2.1.3.RELEASE.pom.
Return code is: 501 , ReasonPhrase:HTTPS Required.
编译时报错,显示连接中央仓库501
经过百度得知,原来中央仓库不再支持http访问,需要将路径更改为https

 

 这个路径需要我们修改maven中的配置文件setting

首先,找到jenkins环境变量中配置的maven安装路径,一般在部署jenkins的服务器上

然后再maven安装路径的conf文件夹下,有个setting文件,我们在其中找到mirror部分

<mirror>

<id>central</id>

<name>Maven Repository Switchboard</name>

<url>https://repo1.maven.org/maven2/</url>

<mirrorOf>central</mirrorOf>

</mirror>
将这一段加进去,重新编译就搞定了

注意:我在找maven项目的时候,发现jenkins上系统管理里面,其实是支持直接上传setting配置文件的

在jenkins的全局工具配置中,各位也可以在这里重新提供一个setting文件上传

 

 


					


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM