12 · Spring Boot and the web request lifecycle / LESSON 51 OF 102
Starters, auto-configuration, and condition reports
Boot assembles sensible infrastructure based on classpath, properties, and existing beans.
Before this lesson: Consistent API errors
Understand the topic
A starter is a curated dependency entry point. Auto-configuration registers beans when its conditions match; many configurations back off when you define an equivalent bean. @SpringBootApplication combines configuration, auto-configuration, and component scanning.
Inspect the condition evaluation report before adding exclusions. Adding a JDBC starter can activate datasource configuration, which then requires a suitable database setup. Keep the application class above your feature packages so scanning has a clear boundary.
EXAMPLE · SHELL
Terminal
./mvnw spring-boot:run -Dspring-boot.run.arguments=--debugWhat to expect
The local startup log includes condition outcomes that explain why configurations matched or did not match. Avoid sharing logs containing configuration secrets.
YOUR TURN
Put it into practice
- 01Compare startup with and without a data-access starter.
- 02Read the condition report and identify the configuration that requests a DataSource.
- 03Verify: You explain the startup change using dependency and condition evidence.
Pass a quiz or complete a lab to check today’s streak. Each lesson counts once per day, including when you review it later.
UNDER THE HOOD
Build the mental model
Boot assembles sensible infrastructure based on classpath, properties, and existing beans.
- 01A starter is a curated dependency entry point. Auto-configuration registers beans when its conditions match; many configurations back off when you define an equivalent bean. @SpringBootApplication combines configuration, auto-configuration, and component scanning.
- 02Inspect the condition evaluation report before adding exclusions. Adding a JDBC starter can activate datasource configuration, which then requires a suitable database setup. Keep the application class above your feature packages so scanning has a clear boundary.
- 03Trace the example: The local startup log includes condition outcomes that explain why configurations matched or did not match. Avoid sharing logs containing configuration secrets.
A mistake worth avoiding
Startup suddenly requests database properties after adding a dependency.
DEBUGGING ROOM
Something broke. Where do you look?
Startup suddenly requests database properties after adding a dependency.
Before revealing the diagnosis, write down your first investigation step.
CHECK YOUR UNDERSTANDING
Does a starter contain all application business logic?
BUILD IT YOURSELF
Compare startup with and without a data-access starter.
- 1.Compare startup with and without a data-access starter.
- 2.Read the condition report and identify the configuration that requests a DataSource.
- 3.Reproduce this failure, then repair it: Startup suddenly requests database properties after adding a dependency.
Acceptance checklist
Lab completion is your self-report. Knowledge checks do not certify project quality.
RETRIEVE IT FROM MEMORY
Does a starter contain all application business logic?
Revisit this lesson in three days after a successful check or lab.
Ready for the next step?
You explain the startup change using dependency and condition evidence.
Reading is separate from passing a knowledge check or completing a lab.