In this web application with Spring, I created several application-property files for different deploy environment. They specify different db connection configs.
application-dev.properties
application-qa.properties
application-stg.properties
application-prod.properties
The recommended way according to spring doc is to set spring.profiles.active as JVM option at run time, for example:
-Dspring.profiles.active=prod
However what should I do for deploying the application as war using mvn install. How should I set the spring profile? I am using Eclipse.
EDIT:
I set the JVM option under . It does not seem to get picked up by maven when I deploy it as a war though since I got the following error from tomcat:
Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception