【发布时间】:2021-04-11 16:42:27
【问题描述】:
我一直在尝试配置我的 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>
编辑:更正了拼写和图像。仍然,同样的错误。
【问题讨论】:
-
我认为
@SprinBoot甚至不存在。 -
是的。如果我不得不猜测它可能是@SpringBoot
-
我知道 Spring 在注释上拼写错误,但即使拼写正确,它也会给出相同的响应。
-
你在哪里读到你应该有一个
@SprinBoot注释?也许您应该(重新)阅读 Spring Boot 指南,因为它被称为@SpringBootApplication。任何 Spring Boot 教程都会告诉你。 -
更正了拼写
标签: java maven pom.xml spring-boot-starter