When a bean is configured (or mysteriously isn't), run the app with --debug to print the conditions evaluation report — the authoritative list of which auto-configurations matched, which didn't, and the exact condition that decided each. This is the single best debugging tool for "why is this bean here / missing?"
Turning on the report
java -jar app.jar --debug
or in configuration:
debug=true
This does not raise your application log level to DEBUG globally (that's --debug on the logging side vs Boot's debug property — the Boot property specifically enables the conditions report). On startup you get a CONDITIONS EVALUATION REPORT.
Reading the report
============================
CONDITIONS EVALUATION REPORT
============================
Positive matches: ← auto-config that fired, and why
-----------------
DataSourceAutoConfiguration matched:
- @ConditionalOnClass found required class 'javax.sql.DataSource' (OnClassCondition)
Negative matches: ← auto-config that was skipped, and why
-----------------
RabbitAutoConfiguration:
Did not match:
- @ConditionalOnClass did not find required class
'com.rabbitmq.client.Channel' (OnClassCondition)
Exclusions: ← explicitly excluded via spring.autoconfigure.exclude
Unconditional classes: ← always-on infrastructure config
- Positive matches — every condition passed; the config contributed beans. Use this to confirm why something you didn't expect got configured.
- Negative matches — the precise condition that failed. "My
DataSourceisn't there" usually shows up here as@ConditionalOnClass did not find ...(missing dependency) or@ConditionalOnPropertynot matching.
The most common findings
- Missing jar → a
@ConditionalOnClassnegative match. Add the starter. - Your bean overrode the default → the default appears as a negative match:
@ConditionalOnMissingBean found bean of type .... That's expected, not a bug. - Wrong property value →
@ConditionalOnPropertynegative match. Fix the property name/value (watch relaxed binding).
Complementary tools
- Actuator
/actuator/conditionsexposes the same report over HTTP at runtime — no restart-with-flag needed. - Actuator
/actuator/beanslists every bean actually registered. spring.autoconfigure.exclude(or@SpringBootApplication(exclude=...)) to deliberately drop an auto-config, after which it appears under Exclusions.