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] ------------------------------------------------------------------------


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM