Spring Boot environment config hierarchy and precedence

In the previous few recipes, we have seen how to package our application in a variety of ways and how it can be deployed. The next logical step is the need to configure the application in order to provide some behavioral control as well as some environment-specific configuration values, which could and most likely will vary from environment to environment.

A common example of such an environmental configuration difference is the database setup. We certainly don't want to connect to a production environment database with an application running on our development machine. There are also cases when we want an application to run in different modes or use a different set of profiles, as they are ...

Get Spring Boot Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.