Eclipse Maven报错:Could not transfer artifact org.apache:apache:pom:21
- 问题:
使用Eclipse的Import git导入码云中的Maven项目后,在Problem框中出现build error: Non-resolvable parent POM for org.apache.shardingsphere:shardingsphere:5.0.0-RC1-SNAPSHOT: Could not transfer artifact org.apache:apache:pom:21 - 排查:
2.1 排查maven源设置
打开eclipse内的maven配置文件,添加阿里源:
Eclipse → Window → Preferences → Maven → User Settings → open file
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
重新update项目后,发现Error依然存在。
2.2 排查maven源连通性
访问阿里的服务状态正常。
2.3 原因定位
重新update项目,在update过程中点击Progress查看过程信息,发现报错:
无法创建“C:\Users\Administrator.m2\repository\org\apache\apache\21\apache-21.pom”文件
发现win10系统使用云账号,本地的Administrator账户没有打开,所以导致没有这个目录。
4. 解决:
手动建立对应目录,“以管理员身份运行”Eclipse,重新update项目。
问题解决。