Maven 编译提示:spring-boot-maven-plugin:2.1.9.RELEASE or one of its dependencies could not be resolved

羊舌新荣
2023-12-01

问题描述:今天使用mava-plugin 插件遍历Maven项目提示如下错误信息:

[ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:2.1.9.RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.springframework.boot:spring-boot-maven-plugin:jar:2.1.9.RELEASE: 1 problem was encountered while building the effective model for org.springframework.boot:spring-boot-maven-plugin:2.1.9.RELEASE
[ERROR] [FATAL] Non-parseable POM C:\Users\zzg\.m2\repository\org\springframework\boot\spring-boot-parent\2.1.9.RELEASE\spring-boot-parent-2.1.9.RELEASE.pom: processing instruction can not have PITarget with reserved xml name (position: END_TAG seen ...</issueManagement>\n</project>\n<?xml ... @46:7)  @ C:\Users\zzg\.m2\repository\org\springframework\boot\spring-boot-parent\2.1.9.RELEASE\spring-boot-parent-2.1.9.RELEASE.pom, line 46, column 7
[ERROR] -> [Help 1]
[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/PluginResolutionException

错误大致含义:

1、maven-plugin插件读取指定jar 失败。

2、maven-plugin无法加载 C:\Users\zzg\.m2\repository\org\springframework\boot\spring-boot-parent\2.1.9.RELEASE\spring-boot-parent-2.1.9.RELEASE.pom, 因为xml 文件中包含PITarget

(=spring-boot-parent-2.1.9.RELEASE.jar 没有正常加载)

解决版本:

移除C:\Users\zzg\.m2\repository\org\springframework\boot\spring-boot-parent\2.1.9.RELEASE 文件夹,重新编译Maven 项目

C:\workspace\Single>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< com.digipower:Single >------------------------
[INFO] Building Single 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from alimaven: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-parent/2.1.9.RELEASE/spring-boot-parent-2.1.9.RELEASE.pom
Downloaded from alimaven: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-parent/2.1.9.RELEASE/spring-boot-parent-2.1.9.RELEASE.pom (1.8 kB at 1.7 kB/s)
Downloading from alimaven: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-maven-plugin/2.1.9.RELEASE/spring-boot-maven-plugin-2.1.9.RELEASE.jar
Downloaded from alimaven: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-maven-plugin/2.1.9.RELEASE/spring-boot-maven-plugin-2.1.9.RELEASE.jar (68 kB at 103 kB/s)
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ Single ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ Single ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to C:\workspace\Single\target\classes
[INFO] /C:/workspace/Single/target/generated-sources/annotations/com/single/entity/helper/UcasAuthUserMapping.java:  某些输入文件使用了未经检查或不安全的操作。
[INFO] /C:/workspace/Single/target/generated-sources/annotations/com/single/entity/helper/UcasAuthUserMapping.java:  有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.832 s
[INFO] Finished at: 2021-11-03T11:08:32+08:00
[INFO] ------------------------------------------------------------------------

 

 类似资料: