Chapter plan
What you will complete
01Properties vs YAMLExternalize configuration into .properties or YAML and control which source wins when locations, environment variables, and command-line arguments overlap.application.propertiesapplication.ymlEnvironment Variables 15 min02Type-Safe Configuration with @ConfigurationPropertiesGroup related settings into a validated, type-safe class instead of scattering @Value strings through the codebase.Bind nested configuration blocks to records with relaxed bindingValidate configuration at startup before requests arriveReserve @Value for single, trivial lookups 25 min03Environment ProfilesProfiles split environment-specific configuration into named sets; each deployment activates exactly one and the startup log proves which.@Profilespring.profiles.activeapplication-{profile}.yml 15 min04Secrets Management & Environment SafetyPasswords, API keys, and tokens come from the environment or a vault—never from files under version control.Reference secrets with ${ENV_VAR} placeholders instead of literalsProvide non-secret defaults while keeping secrets requiredScan history and rotate anything that ever leaked 20 min
Module outcome
Ship one artifact into dev, test, and production with only the environment changing, and keep credentials out of the repository.
Mental model
Configuration is data the application reads at startup; environments differ in data, never in code.
Module checkpoint
Twelve-factor task API
Externalize ports, database URLs, feature flags, and SMTP credentials for three environments.
- Same JAR boots dev and prod via profile plus env vars
- Typed @ConfigurationProperties with validated values
- No secret present anywhere under version control
Final module assessment
Ready to prove mastery?
Complete all 50 questions after finishing the module lessons and checkpoint.