当我使用 Eclipse STS 工具生成 Spring 启动项目时,pom.xml 第一行出现错误。但是我在 pom.xml 中没有发现错误

When I generate Spring starter project with eclipse STS tools there is an error occurs in pom.xml first line. But I found no error in pom.xml

我在创建项目后使用 Eclipse STS 工具创建了一个 Spring 启动项目,但首先在 pom.xml 中出现错误。但是我没有发现错误。我已尝试使用和不使用强制更新项目,但错误仍然存​​在

谢谢


<?xml version="1.0" encoding="UTF-8"?> <!-- error occurs here -->
<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.web-app</groupId>
    <artifactId>FirstWebApp</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>FirstWebApp</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-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </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>


项目运行但不工作。 [这是eclipse工作区的图像] [1]: https://i.stack.imgur.com/a9fGB.png

好吧,这是使用 Spring Boot 2.1.5 时最新的 well known problem Eclipse。

解决方法是将以下内容添加到 pom.xml

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