What is the role of `@SpringBootApplication` annotation?
The @SpringBootApplication
annotation is a convenience annotation in Spring Boot that combines three important annotations to simplify the setup of a Spring Boot application:
@SpringBootConfiguration
: Marks the class as a Spring configuration class.@EnableAutoConfiguration
: Tells Spring Boot to automatically configure application components based on the classpath and settings.@ComponentScan
: Enables component scanning, allowing Spring to find and register beans in the application context.
In summary, @SpringBootApplication
simplifies Spring Boot application setup by combining key annotations, enabling auto-configuration, component scanning, and configuration capabilities in one.