简体   繁体   English

为什么Springs自动生成的pom文件不可解析?

[英]Why is Springs auto generated pom file un parsable?

I've been trying to setup a spring websocket server using the stat.spring.io generator which generates a pom file etc. 我一直在尝试使用stat.spring.io生成器来设置spring websocket服务器,该生成器会生成pom文件等。

It seems that the generated pomfile is unparsable for some reason and i've spent hours trying to fix it. 似乎由于某种原因,生成的pomfile无法解析,我花了数小时试图对其进行修复。

I've tried using Java 1.7 with spring 2. . 我已经尝试在Spring 2中使用Java 1.7 to no avail. 无济于事。

Please can someone help explain why it might not be parsing: 请有人帮忙解释为什么可能无法解析:

Here is my full pomfile: 这是我完整的pomfile:

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

<groupId>com.example</groupId>
<artifactId>ws-analytics-gateway</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>ws-analytics-gateway</name>
<description>Demo project for Spring Boot</description>

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

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

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-websocket</artifactId>
    </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>

The pom.xml you have posted is not valid XML. 您发布的pom.xml是无效的XML。 it is missing a closing tag for project as mentioned above. 如上所述,它缺少项目的结束标记。 Also, you mention using java 1.7 with spring 2. 另外,您提到在Spring 2中使用Java 1.7。

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes#java-8-baseline-and-java-9-support states: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes#java-8-baseline-and-java-9-support状态:

Spring Boot 2.0 requires Java 8 as a minimum version. Spring Boot 2.0要求Java 8为最低版本。

I checked your XMl by pasting it here: https://www.xmlvalidation.com/index.php?id=1&L=0 you may wish to have that check pass first. 我通过将您的XMl粘贴在这里进行了检查: https ://www.xmlvalidation.com/index.php?id =1& L =0您可能希望首先通过该检查。

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

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