The @SpringBootApplication annotation explained
In this article, I will be explaining the @SpringBootApplication annotation. Edit What is the @SpringBootApplication annotation The @SpringBootApplication annotation is a convenience annotation that combines the @EnableAutoConfiguration , @Configuration and the @ComponentScan annotations in a Spring Boot application. These annotations do the following: @EnableAutoConfiguration – This enables Spring Boot’s autoconfiguration mechanism . Auto-configuration refers to creating beans automatically by scanning the classpath. @ComponentScan – Typically, in a Spring application, annotations like @Component, @Configuration, @Service, @Repository are specified on classes to mark them as Spring beans. The @ComponentScan annotation basically tells Spring Boot to scan the current package and its sub-packages in order to identify annotated classes and configure them as Spring beans. Thus, it designates the current package as the root package for component scanning. @Configuration – D