4

I couldn't solve the problem of SpringBoot Keyword which is highlighted in red in Intellij IDEA. I used the invalidates cache and synchronise option in IntelliJ but still not solved the problem.

Image of the Error

POm.xml

Hover Error image

POM.xml

<?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>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>12</java.version>
    </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>
        </dependency>
    </dependencies>

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

</project>
M. Deinum
  • 104,041
  • 21
  • 200
  • 207
sonam wangmo
  • 223
  • 3
  • 11

2 Answers2

2

Here is the solution, guys. I found it on stackoverflow.

I fixed the problem adding the version of the plugin in the pom.xml, which is the same of spring boot's version.

<groupId>org.springframework.boot</groupId> 
<artifactId>spring-boot-maven-plugin</artifactId> 
<version>${project.parent.version}</version>
Xaxage
  • 211
  • 1
  • 2
  • 8
1

I had same problem. I inserted this line:

<version>2.4.1</version>

under the

<artifactId>spring-boot-maven-plugin</artifactId>

line, then loaded Maven changes (when little blue Maven icon popped up), red text became white (grey, etc.), seems ok now.

gercike
  • 19
  • 2