Maven构建报错pom.xml存在重复configuration标签该如何解决?
根因定位
pom.xml文件存在重复的configuration标签,不符合XML格式规范,Maven无法解析该配置文件,该问题与VS Code本身无关。
修复方案
- 打开项目根目录下的
pom.xml文件,跳转至第80行,报错日志已明确标记错误位置为第80行第24列 - 检查该位置上下的标签结构,删除多余的重复
<configuration>标签,保证XML标签唯一、层级闭合合法 - 保存文件后重新执行Maven命令即可恢复正常
错误日志参考
[INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-parseable POM c:\Users\wikim\Desktop\Java\argbot\pom.xml: Duplicated tag: 'configuration' (position: START_TAG seen ...</dependencies>\r\n <configuration>... @80:24) @ line 80, column 24 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project (c:\Users\wikim\Desktop\Java\argbot\pom.xml) has 1 error [ERROR] Non-parseable POM c:\Users\wikim\Desktop\Java\argbot\pom.xml: Duplicated tag: 'configuration' (position: START_TAG seen ...</dependencies>\r\n <configuration>... @80:24) @ line 80, column 24 -> [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.
内容的提问来源于stack exchange,提问作者pmalys
相关产品推荐
相关产品推荐

