What you need:
1) Define the active profile that you need, for example:
spring.profiles.active=dev
In this example, the downloaded file will be application-dev.properties
Now, if you need to switch to another environment, depending on where you install your war file, then what you can do is set this variable as a system variable in each environment you want, so each environment has a different meaning for same key, something like:
-Dspring.profiles.active=dev
In my case, I use Tomcat, and I declare this key / value in the setenv.sh file, you need to assign this value depending on the server you are using.
Eduardo
source share