In this web application with Spring, I created several application properties files for different deployment environments. They define different db connection configurations.
application-dev.properties
application-qa.properties
application-stg.properties
application-prod.properties
The recommended method according to spring doc is to set spring.profiles.active as a JVM option at runtime, for example:
-Dspring.profiles.active=prod
However, what should I do to deploy the application as a warfare using the mvn installation. How to set up spring profile? I am using Eclipse.
EDIT : I set the JVM option to
. It doesn't seem like maven picks it up when I deploy it like a war, though, since I got the following error from tomcat:
Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception