Interview questions
Question 60 of 254
FreeHow does Spring Boot's auto-configuration mechanism actually work?
Spring Boot Fundamentals
Auto-configuration classes are ordinary @Configuration classes bundled inside spring-boot-autoconfigure, each guarded by @Conditional annotations (like @ConditionalOnClass, @ConditionalOnMissingBean) that only let it register its beans if certain conditions hold — typically, that a relevant library is present on the classpath and the developer hasn't already defined a conflicting bean themselves. @EnableAutoConfiguration triggers Spring Boot to evaluate every candidate auto-configuration class listed in a metadata file and apply the ones whose conditions pass.
Intermediate5 min

