I have 2 URLs among which 1 is specific to Dev and the other to Prod. I am also using Spring profiling where i have seperate file for dev and prod application-dev.properties and application-prod.properties and my appication.properties file look like this for Dev env
spring.profiles.active=dev
Now in my java code i want to have one property which will bind to the appropriate value depending on the spring profile i am using. How can i do it.
Current Java Class:-
//DEV
private static final String WIND_RESOURCE_EXTRACTOR_URL = "https://localhost:9090/dev";
//FOR PROD
//private static final String WIND_RESOURCE_EXTRACTOR_URL = "https://localhost:9090/prod";
SO i want to mention this properties in my application-dev.properties or application-prod.properties file and my java class should pick the correct value based on the current spring profile.