eclipse springboot项目,有时候会出现如下错误Project build error: Non-resolvable parent POM

一.在IDEA创建的Springboot项目,在导入Eclipse时,或者直接在eclipse初次创建springboot项目,有时候会出现如下错误。

Project build error: Non-resolvable parent POM for com.zwp:HelloWord:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.0.3.RELEASE from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact
org.springframework.boot:spring-boot-starter-parent:pom:2.0.3.RELEASE from/to central
(https://repo.maven.apache.org/maven2): Received fatal alert: protocol version and
‘parent.relativePath’ points at wrong local POM

在这里插入图片描述

二.解决方案有二个;

1.方式一:

因为你未配置maven镜像使用的是默认的,建议在maven的setting中配置国内镜像;

maven的setting配置和引入步骤;

配置完成之后更新项目 maven->update project

2.方式二

在pom.xml 加上一段依赖:

spring-snapshots http://repo.spring.io/libs-snapshot
<pluginRepositories>  
    <pluginRepository>  
        <id>spring-snapshots</id>  
        <url>http://repo.spring.io/libs-snapshot</url>  
    </pluginRepository>  
</pluginRepositories>

配置完成之后更新项目即可;

两种方式建议使用第一种方式;
但是我在使用第一种方式(原本就是用的阿里镜像)没有用,换了多个镜像也没有作用, 但是第二种方式有作用

————————————————
版权声明:本文为CSDN博主「黄粱一梦-努力努力」的原创文章,
原文链接:https://blog.csdn.net/qq_26369317/article/details/80816098

猜你喜欢

转载自blog.csdn.net/weixin_41367523/article/details/106546745