问题描述
我一直在尝试配置我的 pom 文件以使用 maven 启动一个 springboot 项目。我是这样配置的,但我无法在我的班级中将注释转换为导入。我的 pom 文件中的 spring starter 也显示为红色。我正在使用 Intellij。
<groupId>io.github.murillojndem</groupId>
<artifactId>vendas</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
编辑:更正了拼写和图像。还是一样的错误。
解决方法
你可以做一些事情来尝试修复它。 1- 点击注释顶部的灯,看看是否有修复指南。
如果第一点不奏效,那么你就按照下一步 2- 打开你的 bash 并输入“mvn clean install”