6

I couldn't solve the problem of Spring Boot leyword which is highlighted in red in IntelliJ IDEA. I used the invalidate cache and synchronise option in IntelliJ, but this did not solve 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>
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
sonam wangmo
  • 263
  • 3
  • 13

1 Answers1

3

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.

Make sure to check your version before putting as above. Please refer below steps to that. Go to maven table in the left corner of the IDE. Then click on plugins and find the version as in the images attached below.maven icon find plugging version

gercike
  • 39
  • 2