Search⌘ K

Configuration and Application Start-Up

Explore the use of the @SpringBootApplication annotation to configure Spring Boot projects. Understand how it combines key annotations for component scanning, configuration, and auto-configuration. Learn how to start the application using Java or Gradle and how to verify the app response with cURL.

SpringBootApplication annotation

Open the TodoApplication class in the src/main/java/io/educative package and check out the @SpringBootApplication annotation.

Java
package io.educative;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class TodoApplication {
public static void main(String[] args) {
SpringApplication.run(TodoApplication.class, args);
}
}

This annotation contains a combination of the following three primary annotations:

  • The @ComponentScan annotation looks for components like controllers, services, and repositories to add them to the
...