Card 06/ 06

RecapDifficulty: Advanced1 min

Recap: Configuring a Boot Application

The order of sources, command-line overrides, profiles, and binding properties into code.

Configuring a Boot application comes down to the four ideas below, each listed with the card that covers it.

What the topic established, and which card it was on
The ideaWhere
Command line beats environment variables, which beat profile files, which beat application.propertiesConfiguration Properties: Where They Come From and Which Wins
Passing a property at startup overrides the file without editing itConfiguration Example: A Command-Line Argument Overrides the File
A profile switches a whole set of properties behind one nameProfiles Example: Switching a Whole Set of Properties at Once
@Value for a single property, @ConfigurationProperties for a related group@Value vs @ConfigurationProperties

Together they give the usual setup: defaults in application.properties, one profile file per environment, and anything secret or machine-specific passed in at startup.