当我使用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

查看:90
本文介绍了当我使用Eclipse STS工具生成Spring入门项目时,pom.xml第一行出现错误.但是我发现pom.xml中没有错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建项目后,我已经使用eclipse STS工具创建了一个Spring入门项目,首先在pom.xml中出现错误.但是我没有发现错误.我已经尝试过用和不用更新项目,但是错误仍然存​​在

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

谢谢


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


项目正在运行,但无法正常工作. [这是蚀工作区的图像] [1]: https://i.stack.imgur .com/a9fGB.png

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

推荐答案

好,这是最新的使用Spring Boot 2.1.5时,Eclipse的一个众所周知的问题.

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

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

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

这篇关于当我使用Eclipse STS工具生成Spring入门项目时,pom.xml第一行出现错误.但是我发现pom.xml中没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆