【SpringBoot】Project 'org.springframework.boot:spring-boot-starter-parent:2.4.5' not found

问题

新建SpringBoot项目后,项目正常运行,但是pom.xml文件提示“Project ‘org.springframework.boot:spring-boot-starter-parent:2.4.5’ not found” 。

解决

出现这种问题,是由于在当前的仓库中找不到指定的版本Jar包。
通常我们在本地会将远程仓库配置成阿里云镜像,如果pom.xml文件中指定的版本过高,可能阿里云镜像仓库中会没有,也就导致了该错误。降低版本即可。

1
2
3
4
5
6
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>