Auto-configurationeasy0-2 years
How does Spring Boot auto-configuration decide what to configure, and how do you find out why a bean is missing?
Auto-configuration classes are registered through AutoConfiguration.imports and each is guarded by @Conditional annotations — most often @ConditionalOnClass (a library is on the classpath), @ConditionalOnMissingBean (you have not already defined one) and @ConditionalOnProperty (a property is set). Spring evaluates every condition and only applies configuration that passes. When something you expected is missing, run the app with --debug or check the actuator /actuator/conditions endpoint for the conditions evaluation report, which lists every auto-configuration class as matched or not, with the reason.