Card 05/ 06

ExerciseDifficulty: Advanced1 min

Which Value Wins?

application.properties sets app.timeout=30. application-prod.properties sets app.timeout=10. The application is started with --spring.profiles.active=prod and no other arguments. What is the effective value of app.timeout, and why?

See the answer

10. Activating the prod profile makes application-prod.properties a higher-priority source than the base application.properties, and nothing on the command line overrides it further — the same ordering the topic opened with, just without a command-line argument in the picture this time.