为什么 pom.xml 文件给出未知错误

Why does pom.xml file give an unknown error

我正在尝试学习 spring 引导和安装 spring 引导到 eclipse IDE。当我创建我的第一个项目时,它在 pom.xml 的第一行显示错误。它显示为未知错误。

我尝试了很多来自 Whosebug 的解决方案。但是 none 对我有用。

Maven pom.xml error in eclipse When maven says "resolution will not be reattempted until the update interval of MyRepo has elapsed", where is that interval specified?

我的pom.xml如下。

 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.5.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

</project>

谁能帮我解决这个问题。

我 2 周前遇到了同样的问题。然后,我通过添加如下一行来修复它

<properties>
    <!-- ... -->
    <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>

似乎错误已在 Eclipse 中修复。
只需更新您的 Eclipse 或 STS4。您可能会看到 m2e connector 包含在更新列表中。