E
E
Elzee2020-02-20 17:58:27
Java
Elzee, 2020-02-20 17:58:27

Why aren't Spring Boot annotations imported?

I want to create a Spring Boot application, but for some reason the Spring annotations are not imported, I don’t even get a compilation error, but the process is simply cut down and everything stops. What to do in this case?

Here Spring components are not imported, but this pops up:
@org.springframework.boot.autoconfigure.SpringBootApplication

package net.proselyte;

@org.springframework.boot.autoconfigure.SpringBootApplication
public class SpringBootApplication {
    public static void main(String[] args) {
    }
}


<?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.2.4.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>net.proselyte</groupId>
    <artifactId>SpringBootCRUDapp</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>2.2.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>


An error pops up in the debugger:
Connected to the target VM, address: '127.0.0.1:51461', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:51461', transport: 'socket'

5e4e9e0b45ee5201306301.png
5e4e9e5f20d8c841006600.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergey, 2020-02-20
kuzmin @sergueik

Elzee you don't have a main
piece

SpringApplication.run(SpringBootApplication.class, args);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question