简体   繁体   English

从 https://start.spring.io/ 下载后 pom.xml 显示错误

[英]pom.xml showing error after being downloaded from https://start.spring.io/

trying to follow a tutorial on developing web application with spring, thymeleaf, hibernate and mysql database.尝试遵循有关使用 spring、thymeleaf、hibernate 和 mysql 数据库开发 Web 应用程序的教程。 I created the project using https://start.spring.io/ after downloading the zip, pom.xml shows error marking the heading tag下载 zip 后,我使用https://start.spring.io/创建了项目,pom.xml 显示标记标题标签的错误

i have ran maven build and maven clean, both is successful but the error still is not going.我已经运行了 maven build 和 maven clean,两者都成功了,但错误仍然没有发生。

//I get the error on the first line with no hint at all //我在第一行得到错误,没有任何提示

<?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.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>net.codejava</groupId>
    <artifactId>ProductManager</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>ProductManager</name>
    <description>Spring boot CRUD web app Example</description>

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

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

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </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>

You can try to downgrade your boot version to 2.1.4.RELEASE您可以尝试将引导版本降级到 2.1.4.RELEASE

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.4.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

OR或者

update your maven version to the newest one.将您的 Maven 版本更新为最新版本。 Download maven下载行家

If you are using eclipse then it's eclipse issue,if you can just run the spring project and check whether is it running fine?如果您使用的是 eclipse 那么它是 eclipse 问题,如果您可以运行 spring 项目并检查它是否运行正常? If it's running then don't worry.如果它正在运行,请不要担心。 Sorry for lot's of assumption as the question is ambiguous.很抱歉有很多假设,因为问题不明确。

I have faced same problem in eclipse.The projects generated from start.spring.io didn't have any packaging info jar/war.我在 eclipse 中遇到了同样的问题。从 start.spring.io 生成的项目没有任何包装信息 jar/war。

<groupId>net.codejava</groupId>
<artifactId>ProductManager</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

Now it is not showing any after adding "packing".现在添加“打包”后没有显示任何内容。 Later maven>update project后来maven>更新项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM