一、下载com.alibaba.cloud失败
下载com.alibaba.cloud失败,报错内容
无法解析 com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config:pom:2.2.1.RELEASE failed to transfer from https:...................
错误原因:无法在远程仓库中
解决方法:
1.查看maven工程settings.xml的地址
![](https://img-blog.csdnimg.cn/direct/667563004cdc454faeacb6ec20193be3.png)
用户设置文件即为settings.xml
2.添加阿里云maven仓库地址
编辑settings.xml文件,按CTRL+F打开搜索框,搜索mirror
找到mirrors模块,添加以下代码
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
接着重新重新加载maven项目,可以在pom.xml文件空白处按右键
二、本地仓库有jar包,但依然从远程仓库下载
出现这种情况的原因,一般是本地仓库中存在之前下载jar包失败的残留文件,只需要将这些文件清楚即可。文件后缀一般为
"lastUpdated",
"properties",
"repositories