Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 创建Spring Starter项目时POM文件出错_Spring Boot - Fatal编程技术网

Spring boot 创建Spring Starter项目时POM文件出错

Spring boot 创建Spring Starter项目时POM文件出错,spring-boot,Spring Boot,我刚刚在STS中创建了一个新的Spring Starter项目。创建之后,可以看到它并没有作为MAVEN项目完全加载。在POM文件中看到以下错误 项目生成错误:不可解析的POM C:\Users\salim.m2\repository\org\springframework\boot\springbootstarter- parent\2.3.0.RELEASE\spring-boot-starter-parent-2.3.0.RELEASE.pom:意外标记\n 不知道发生了什么。请帮我做这个

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

项目生成错误:不可解析的POM C:\Users\salim.m2\repository\org\springframework\boot\springbootstarter- parent\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启动程序父级 2.3.0.1发布 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>

1.8
UTF-8
UTF-8
org.springframework.boot
弹簧靴起动器
org.springframework.boot
弹簧起动试验
测试
org.junit.vintage
朱尼特老式发动机
org.springframework.boot
springbootmaven插件

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

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

4.0.0
org.springframework.boot
spring启动程序父级
2.3.0.1发布
com.vishnu.ws.soap
hellowebservice
0.0.1-快照
hellowebservice
SOAP服务

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

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

4.0.0
org.springframework.boot
spring启动程序父级
2.3.0.1发布
com.vishnu.ws.soap
hellowebservice
0.0.1-快照
hellowebservice
SOAP服务

请使用pom.xml更新问题
标记在哪里?如果您使用的是spring的旧版本,请尝试从m2中删除spring jar(删除目录)。我认为如果您的pom是正确的,这将有所帮助。请使用您的pom.xml更新问题
标记在哪里?如果您使用的是spring的旧版本,请尝试从m2(删除目录)中删除spring jar。我认为如果您的pom是正确的,这将有所帮助。