首页 > 其他分享 >【SpringBoot】springProject‘org.springframework.boot:spring-boot-starter-parent:2.x.x‘ not found

【SpringBoot】springProject‘org.springframework.boot:spring-boot-starter-parent:2.x.x‘ not found

时间:2022-08-31 10:44:47浏览次数:57  
标签:缓存 SpringBoot parent spring boot IDEA starter

IDEA中搭建Spring体系,maven子项目引入父项目,子项目的pom文件和maven插件中会提示红色错误:

 

 

EA默认会缓存Maven本地库中的依赖项,导致引入的依赖版本在仓库中没找到。

IDEA之所以快,就是因为IDEA打开新的工程的时候,它会构建项目索引以及生成相关缓存。
如果IDEA缓存被破坏,会导致IDEA无法识别maven依赖,从而导致idea无法找到某些类。
我们只需要删除原先的缓存以及索引,IDEA重新构建缓存以及索引后,即可正常。

首先,我们检查版本号是否填写有误:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.2</version>
        <relativePath/> 
        <!-- lookup parent from repository -->
    </parent>

然后,通过IDEA自带的缓存清除功能“Invalidate Caches/Restart”,清除IDEA的缓存,如图

 

 清除后,IDEA会自动启动,启动后,右击pom.xml执行Maven的“Reload project”,重新加载Maven,等待加载完毕后,问题解决。

 

 特别的,如果还是不生效,则需要检查该spring-boot-starter-parent版本是否存在

标签:缓存,SpringBoot,parent,spring,boot,IDEA,starter
From: https://www.cnblogs.com/liyanxi/p/16642164.html

相关文章