I want to execute environment specific application-{PROFILE}.properties file (which I have set in my environment variable) in my application. So let us say I have environment defined as "prod", so the application should use application-prod.properties file. Kindly suggest me how to achieve this. Thank you in advance.
Edit 1: I am using java -jar MyApp.jar to run. And suppose I have 4 application.properties files in my app, and I want my app to use the application-dev.properties file ( here dev is defined in my environment variable)
Edit 2: I can't use spring.profiles.active in application.properties file, because in that case I will have to change every time I will run my jar in different env, let us say dev,uat and prod.