处理POM时出现Maven错误:[FATAL]不可解析的POM ... PITarget,保留了xml名称

时间:2018-08-09 20:46:33

标签: spring eclipse maven spring-boot

任何人都不知道为什么在Springsource Tool Suite中导入Spring Boot项目后会立即出现此错误:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM C:\Users\...\.m2\repository\com\fasterxml\oss-parent\33\oss-parent-33.pom: processing instruction can not have PITarget with reserved xml name (position: END_TAG seen ...</profiles>\n\n</project>\n<?xml

我到处看,遇到的唯一类似问题是:

  • this,但是,解决方案是创建一个新的工作空间来解决它。它对我不起作用。
  • this,但这对我也不起作用。

任何帮助将不胜感激。

谢谢!

4 个答案:

答案 0 :(得分:3)

显然,这与我的代码库或POM无关。在删除“ .m2”目录中的所有内容并重建项目后,它开始正常运行。

答案 1 :(得分:1)

有时pom.xml中的空白行导致Maven失败,并出现上述错误。 删除开头的空白行后,它对我有用。

答案 2 :(得分:1)

检查是否

<?xml version="1.0" encoding="UTF-8"?>

您的XML(pom.xml或settings.xml等文件)中的行重复

答案 3 :(得分:0)

请在 pom.xml 中更改您的父级。我使用了以下 XML 并解决了问题

 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.3</version>
        <relativePath/>
    </parent>

相关问题