一、删除maven本地仓库以 .lastUpdated 结尾的文件
mac的本地仓库路径一般为cd ~/.m2/repository
二、添加镜像
<repositories>
<repository>
<id>maven-ali</id>
<url>http://maven.aliyun.com/nexus/content/repositories/central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
三、切换maven的版本
Preference -> Maven -> Maven home path -> 选择其他版本的maven
四、其他问题
1,Cannot resolve plugin org.springframework.boot:spring-boot-maven-plugin:2.4.4
换个其他的版本解决
<version>2.4.4</version>
2,右侧maven插件dependency爆红
关掉项目重新打开
五、参考
【1】Could not transfer artifact xxx from/to xxx解决方案:https://blog.csdn.net/m0_37138008/article/details/104428616
【2】SpringBoot添加依赖包Could not transfer artifact XXX from/to central错误的问题:https://blog.csdn.net/nineya_com/article/details/103328985
【3】SpringBoot 导入插件报错 Cannot resolve plugin org.springframework.boot:spring-boot-maven-plugin:2.4.1







网友评论