spring 2.5: loading environment specific properties file

226 Views Asked by At

I have a legacy application on which I am working to implement some requirements. While doing so, I want to load the environment specific properties file for each environment. For example:

<context:property-placeholder location="classpath:myResource/data.properties" />

I want to load this data.properties file based on the environment like local,dev,qa. I know we have profile configuration after Spring 3.0 but we do not have any plan soon to upgrade the current version. Is there a way I could accomplish this the way we can do by activating the profile?

I tried the below approach but did not work:where I passed jvm arguments as -Dprofile=dev

<context:property-placeholder ignore-resource-not-found="true" location="classpath:myResource/data-${profile}.properties/>
0

There are 0 best solutions below