Skip to content
Ameen Abozaid
Planned lessonJNR-012-L04

Property-source precedence

  • Lesson 4 of 5
  • Junior
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_TAXRATE or SHOP_TAX_RATE maps to shop.tax-rate by 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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.