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.
In more detail
Adding the web starter brings a web server and Spring MVC; adding a database driver brings a data source. Each auto-configuration sits behind conditions, and it backs away when you define your own bean. The condition evaluation report explains which ones matched and why.
Related terms
- 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.
- 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.
- class path — The list of folders and JAR files the JVM and the compiler search to find classes.
- Spring Boot — A project built on the Spring Framework that starts an application from one main class and auto-configures infrastructure such as a web server from the libraries on the class path.
Taught in
- Spring Boot Auto Configuration — Modern Java: Virtual Threads & High-Throughput Services