I have just taken on this project and its in an interesting state. I am trying to establish a local, dev, and production environment. I have it working and was curious to know if there is a better way or if the way I am doing it has risks.
Inside my Dispacher-Servlet.xml i have this line:
<context:property-placeholder location="classpath:application_${spring.profiles.active}.properties" />
Then I have a setenv.sh file that uses:
JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=local"
Then inside of my controller to reference the variables I use:
@PropertySource("classpath:application_${spring.profiles.active}.properties")
Like I said it seems to work ok, it just doesn't seem to be what the documentation points you to do.