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

巧了我就是萌 提交于 2019-12-08 13:43:08

问题


I have created a Spring starter project with eclipse STS tool after creating project there is an error in pom.xml first. But I found no error. I have tried Updating project with and with out forcefully but error still persists

Thank you


<?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>


Project runs but not working. [This is the image of eclipse workspace] [1]: https://i.stack.imgur.com/a9fGB.png


回答1:


Well , this is the latest well known problem of Eclipse when working with Spring Boot 2.1.5.

The workaround is to add the following to pom.xml :

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


来源:https://stackoverflow.com/questions/56448445/when-i-generate-spring-starter-project-with-eclipse-sts-tools-there-is-an-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!