-2

I've been tring to configure my pom file to start a springboot project with maven. I configured it like this but I can't convert an annotation into an import in my class. The spring starter on my pom file show in red too. I'm using intellij.

enter image description here

<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>

enter image description here enter image description here

Edit: corrected the spelling and the image. Still, same error.

  • 1
    I don't think `@SprinBoot` even exists. – terrorrussia-keeps-killing Jan 05 '21 at 22:06
  • Yeah. If I had to guess it would probably be @SpringBoot – J. Lengel Jan 05 '21 at 22:08
  • I know Spring is misspelled on the annotation but even spelled correctly it's giving the same response. – Murillo Jorge Jan 05 '21 at 22:08
  • Where did you read that you're supposed to have a `@SprinBoot` annotation? Perhaps you should **(re)read the Spring Boot guide**, because it's called **`@SpringBootApplication`**. Any Spring Boot tutorial will tell you that. – Andreas Jan 05 '21 at 22:11
  • Corrected the spelling – Murillo Jorge Jan 05 '21 at 22:11
  • Yeah, I didnt finish the complete @SpringBootApplication annotation just to show that it doesn't even appear anything – Murillo Jorge Jan 05 '21 at 22:12
  • How did you create `pom.xml`? Did you use a Maven archetype to generate the app skeleton from? Did you try using Spring Initializr? Or did you just create an empty `pom.xml` trying to tweak it manually? – terrorrussia-keeps-killing Jan 05 '21 at 22:12
  • Created a project on Intellij following a maven archetype, then added Spring Boot Starter Parent from maven repository, and changed some stuff like a teacher on Udemy told. – Murillo Jorge Jan 05 '21 at 22:34
  • Depending on the settings, IntelliJ might not automatically reimport the POM after making changes. You may have to explicitly refresh (there should be a hovering refresh button in the right-top corner of the pom, or otherwise use the refresh button on the Maven tab). – Mark Rotteveel Jan 06 '21 at 10:59

1 Answers1

-1

You can do some stuffs to try fix it. 1- Click on the lamp on the top of anotation and look if there some guide to fix it.

If the first point not worked, so you follow the next step 2- open your bash and digit "mvn clean install"