Spring Boot Maven插件无法在插件标签中识别

时间:2018-10-25 17:53:59

标签: java spring maven spring-boot

我正在尝试安装Spring Boot Maven插件,但似乎无法正常工作。错误与构建标记一起出现。 Intellij无法识别插件标记内的'sprint-boot-maven-plugin',我不确定为什么。 Intelli可以在依赖项标签中识别i,但是在build标签中不允许它们。请帮忙!

    <?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>org.springframework</groupId>
<artifactId>gs-spring-boot</artifactId>
<version>0.0.1-SNAPSHOT</version>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.6.RELEASE</version>
</parent>


<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <version>2.0.6.RELEASE</version>
</dependency>


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

<build>

    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>2.0.6.RELEASE</version>

        </plugin>
    </plugins>
</build>

1 个答案:

答案 0 :(得分:3)

相关性标签应位于<dependencies>标签内,而不是<project>

...
</parent>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>2.0.6.RELEASE</version>
    </dependency>
</dependencies>

<properties>
...