I have a config.properties file that contains custom properties, e.g. database connection information in webapp deployed to tomcat. eg.
local.driver: com.mysql.jdbc.Driver
local.username:myuser
local.password:mypass
dev.driver: com.mysql.jdbc.Driver
dev.username:mydevuser
dev.password:mydevpass
I can get the values ββfrom config.properties using the spring Environment object or @Value. My question is how to make the spring object of the environment object select local properties when working on local and dev properties when working on dev? It is also not so important to keep confidential data, for example. connecting the production database details in the properties file, which will be placed around in the code base. So how do you add production details in a production environment? Ideally, I would like to change them when and when I like, and there is no need to relocate the application. Am I going in the right direction?
Note. All the answers I've seen on SO discuss changing these properties in Java code. I do not want to do this to configure these values ββregardless of the application code.
thanks