Java|--报错: Failed to create parent directories for tracking file / Non-resolvable parent POM for XXXX: Could not transfer artifact...

完整错误

mvn clean

[INFO] Scanning for projects...
Downloading from alimaven: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-parent/2.5.2/spring-boot-starter-parent-2.5.2.pom
[WARNING] Failed to create parent directories for tracking file /usr/local/apache-maven-3.8.4/ck/org/springframework/boot/spring-boot-starter-parent/2.5.2/spring-boot-starter-parent-2.5.2.pom.lastUpdated
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.example:XXXX: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.5.2 from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public): /usr/local/apache-maven-3.8.4/ck/org/springframework/boot/spring-boot-starter-parent/2.5.2/spring-boot-starter-parent-2.5.2.pom.part.lock (No such file or directory) and 'parent.relativePath' points at no local POM @ line 12, column 13
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.example:XXXX (/home/zhangsan/tmp/test-system/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.example:XXXX: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.5.2 from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public): /usr/local/apache-maven-3.8.4/ck/org/springframework/boot/spring-boot-starter-parent/2.5.2/spring-boot-starter-parent-2.5.2.pom.part.lock (No such file or directory) and 'parent.relativePath' points at no local POM @ line 12, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

提取到的错误↓

Failed to create parent directories for tracking file...
Non-resolvable parent POM for XXXX: Could not transfer artifact

解决方案

#递归修改文件的权限
sudo chmod -R 777 /usr/local/apache-maven-3.8.4/
#一定要注意下面这个命令不行,必须要加参数"-R"
#sudo chmod 777 /usr/local/apache-maven-3.8.4/

成功之后的操作...

mvn clean
[INFO] Scanning for projects...
Downloading from alimaven: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-parent/2.5.2/spring-boot-starter-parent-2.5.2.pom
Downloaded from alimaven: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-parent/2.5.2/spring-boot-starter-parent-2.5.2.pom (8.6 kB at 12 kB/s)
//省略N行...
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.523 s
[INFO] Finished at: 2022-02-14T17:43:30+08:00
[INFO] ------------------------------------------------------------------------
posted @ 2022-02-15 09:07  zh89233  阅读(1458)  评论(0编辑  收藏  举报