user123475
user123475

Reputation: 1105

spring 2.5: loading environment specific properties file

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/>

Upvotes: 0

Views: 208

Answers (0)

Related Questions