【问题标题】:Error in POM file while creating Spring Starter Project创建 Spring Starter 项目时 POM 文件出错
【发布时间】:2020-09-18 20:17:26
【问题描述】:

我刚刚在 STS 中创建了一个新的 Spring Starter 项目。创建后,看到它没有作为 MAVEN 项目完全加载。在 POM 文件中看到以下错误。

项目构建错误:不可解析 POM C:\Users\salim.m2\repository\org\springframework\boot\spring-boot-starter- 父\2.3.0.RELEASE\spring-boot-starter-parent-2.3.0.RELEASE.pom:意外标记\n

不确定发生了什么。请帮我解决这个问题。

https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot spring-boot-starter-parent 2.3.0.发布 com.vishnu.ws.soap hellowebservice 0.0.1-快照 hellowebservice 你好 SOAP 服务

<properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

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

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

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

【问题讨论】:

  • 请用你的 pom.xml 更新问题
  • &lt;parent&gt; 标签在哪里?
  • 如果您使用的是 spring 中的旧版本,请尝试从 m2 中删除 spring jar(删除目录)。我认为如果你的 pom 是正确的会有所帮助。

标签: spring-boot


【解决方案1】:

我不知道你是否正确发布了你的 pom,但它似乎不正确,因此给出了解析错误。它缺少一些标签。对于您的情况,IT 应该是这样的:

<?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 https://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.3.0.RELEASE</version>
    </parent>
    <groupId>com.vishnu.ws.soap</groupId>
    <artifactId>hellowebservice</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>hellowebservice</name>
    <description>SOAP Service</description>

   <!-- additional lines as you have it now -->

 </project>

【讨论】:

    猜你喜欢
    • 2016-12-09
    • 2017-09-10
    • 1970-01-01
    • 2021-11-01
    • 2019-05-29
    • 2016-01-10
    • 2019-10-21
    • 2023-03-05
    • 1970-01-01
    相关资源
    最近更新 更多