Context:property-placeholder import multiple standalone. Properties Profiles in spring?
The spring container uses the discovery mechanism of reflection scanning, which has a org.springframework.beans.factory.config.PropertyPlaceholderConfigurer in the detection of spring containers. The bean will stop scanning the remaining propertyplaceholderconfigurer (Spring 3.1 has used propertysourcesplaceholderconfigurer instead Propertyplaceholderconfigurer).
in other words, the spring container allows only a maximum of one propertyplaceholderconfigurer (or <context:property-placeholder/>) to be defined, The rest will be ignored by spring (in fact, if spring provides a warning).
For example, if the A and B modules are running separately, because the spring container has only one propertyplaceholderconfigurer, the properties file will be loaded and replaced normally. If the A and B two modules are integrated and run, there are two propertyplaceholderconfigurer beans in the spring container, and then look who first who is behind, the first reservation, after the neglect! As a result, only one property file is loaded, resulting in an issue where property substitution cannot be performed correctly.
How to solve it?
Wildcard resolution
< Context:property-placeholder location ="Classpath*:conf/conf*.properties"/>
Context:property-placeholder import of multiple standalone profiles in spring