Property-source precedence
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
know which value wins.
Planned topics
- Many sources can set one property; Boot defines an order, highest priority first (summary).
- Command-line arguments beat environment variables, which beat profile files, which beat the base
application.yml. - Defaults in code are lowest.
- Environment variable
SHOP_TAXRATEorSHOP_TAX_RATEmaps toshop.tax-rateby relaxed binding. - Secrets belong in the environment or a secret store, never in committed YAML. Verify the full order in the docs for your version.
Draft outline details
Demonstration
a ladder: command line → env vars → application-{profile}.yml → application.yml → defaults.
Check your understanding
Which wins: env var or application.yml?
Show answer
The environment variable.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.