问题产生
在 IDEA 2020-01 中从无到有创建了一个 spring-boot 项目以后,发现父模块无法下载!
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.16.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
尝试解决
- 为 Maven 的 settings.xml 文件添加阿里云的 maven 镜像源。无效!
- 对项目清除缓存并将 IDEA 重启。无效!
- 对项目本身重新加载。无效!
- 重启计算机。无效!
最终方案
修改 spring-boot-starter-parent 的版本。有效!
重新载入项目后,依赖库终于正常下载了。看来 IDEA 配置的 spring-boot 版本,镜像源不一定能找到!