【问题标题】:Can't convert anotation into import无法将注释转换为导入
【发布时间】: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


【解决方案1】:

您可以做一些事情来尝试修复它。 1- 点击注释顶部的灯,看看是否有修复它的指南。

如果第一点没有奏效,那么你就按照下一步 2-打开你的 bash 和数字“mvn clean install”

【讨论】:

    猜你喜欢
    • 2021-03-13
    • 2021-09-09
    • 2010-12-03
    • 1970-01-01
    • 2019-03-24
    • 1970-01-01
    • 2011-10-27
    • 1970-01-01
    • 2017-05-15
    相关资源
    最近更新 更多