It may not be exactly what you want, but here is my loading of the xml properties anyway. Places are loaded in order, so the last one will override the previous one, therefore, the class path (i.e. War) first, followed by env of specific files in the file system. I prefer this approach because its one-time configuration points to an external file, but you just modify this external file as necessary, no longer configure the Spring or JVM arguments. In the final place, search for -Dconfig JVM arg, which you give the full path for the prop override file.
Hope this helps.
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreUnresolvablePlaceholders" value="true" /> </bean> <bean class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer"> <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" /> <property name="searchContextAttributes" value="true" /> <property name="contextOverride" value="true" /> <property name="ignoreResourceNotFound" value="true" /> <property name="locations"> <list> <value>classpath:*.properties</value> <value>file:${HOME}/some-env-specific-override.properties</value> <value>${config}</value> </list> </property> </bean>
source share