Menu

Showing posts with label Set spring profile. Show all posts
Showing posts with label Set spring profile. Show all posts

how to set environment to apply the spring application properties file

By default, application.properties file is picked by system for configurations properties. If you have different properties files available to run the application on the different environments then we need to add spring.profiles.active=<environment name> which is present in the application.property file name.


For example, if our application properties file has profile "dev", and the complete file name is application-dev.properties, then we need to set spring.profiles.active=dev in application.properties file, this way application will pic the right configuration file.

Hope this helps!

Spring Framework