记一次jenkins构建项目错误:Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:
错误如下:
Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.3.12.RELEASE from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [alimaven (http://maven.aliyun.com/nexus/content/groups/public/, default, releases)] and 'parent.relativePath' points at no local POM @ line 17, column 13
更多错误日志:
原因
- 我虽然配置了阿里云镜像,但是并没有删除原来默认的镜像,maven在读取镜像时,spring-boot-starter-parent还是从默认的镜像中读取了,导致该依赖不存在
当阿里云镜像与默认镜像同时存在时,所有的依赖都是从阿里云拉取的,但是唯独spring-boot-starter-parent依赖还是从默认镜像中拉取
我在pom中不使用spring-boot-starter-parent依赖,所有的依赖都是从阿里云获取的,如下:
很坑!!!!!
解决办法
删除maven中settings.xml默认的镜像,只保留阿里云镜像
还没有评论,来说两句吧...