I have pasted how we achieve this in our projects. It is pure spring configuration. target.platform is an environment variable. Therefore, we first provide a ganeral project.properties which contain configurations that apply to all applications, then a project specific extension file, and finally an environment specific properties file. Each file is processed in the order they are defined, so same properties are overriden by the later. Hope this helps...
Code:
<bean id="propertyLocations" class="org.springframework.beans.factory.config.ListFactoryBean">
<property name="sourceList">
<list>
<value>classpath:project.properties</value>
<value>classpath:project.extension.properties</value>
<value>classpath:project.extension.${target.platform}.properties</value>
</list>
</property>
</bean>
<bean id="projectProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="locations" ref="propertyLocations"/>
<property name="ignoreResourceNotFound">
<value>true</value>
</property>
</bean>
<bean id="propertyPlaceholderConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="properties" ref="projectProperties" />
<property name="systemPropertiesMode">
<ref local="PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
</property>
<property name="searchSystemEnvironment">
<value>true</value>
</property>
<property name="ignoreUnresolvablePlaceholders">
<value>true</value>
</property>
</bean>
<bean id="PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE"
class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
<property name="staticField">
<value>org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE</value>
</property>
</bean>