conditional configuration
Spring configuration that only applies when a condition holds, such as a class being present, a property being set or no other bean of that type existing.
In more detail
Conditions are why a bean can appear or disappear when a dependency or property changes. Profiles are another kind of condition.
Related terms
- auto-configuration — Spring Boot's mechanism for creating infrastructure beans automatically when their libraries are on the class path and no bean of your own replaces them.
- condition evaluation report — A Spring Boot report, printed when the application starts with --debug, listing which auto-configurations matched and which were skipped, with reasons.
- Spring profile — A named set of configuration, such as local, test or production, that Spring activates to change properties and beans for one environment.
Taught in
- Spring Boot Auto Configuration — Modern Java: Virtual Threads & High-Throughput Services