Auto-Configuration and Spring Boot Starters
Understand how Spring Boot auto-configures beans based on classpath dependencies and condition annotations.
What Is Spring Boot Auto-Configuration?
Auto-configuration automatically configures Spring beans based on what is present on the classpath and in the environment. It eliminates manual @Bean setup for common integrations.
The @SpringBootApplication Annotation
@SpringBootApplication is a composite of @Configuration, @EnableAutoConfiguration, and @ComponentScan. It activates auto-configuration and component scanning.
@SpringBootApplication
public class MyApp {
public static void main(String[] args) {
SpringApplication.run(MyApp.class, args);
}
}All lessons in this course
- Auto-Configuration and Spring Boot Starters
- Application Properties and Profiles
- Bean Wiring: @Component, @Service, @Repository
- Constructor Injection and Circular Dependencies