Card 06/ 06
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.
| The idea | Where |
|---|---|
Command line beats environment variables, which beat profile files, which beat application.properties | Configuration Properties: Where They Come From and Which Wins |
| Passing a property at startup overrides the file without editing it | Configuration Example: A Command-Line Argument Overrides the File |
| A profile switches a whole set of properties behind one name | Profiles 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.
← → move through sections and cards