多环境配置情况下,以下是正确是,即多个.propertes文件必须全部在context:property-placeholder读出来
<beans profile="master1-test">
<context:property-placeholder ignore-unresolvable="false"
file-encoding="UTF-8"
location="classpath:/master1.test.properties,classpath:/autorechrage.properties"/>
</beans>
以下错误
<context:property-placeholder ignore-unresolvable="false" file-encoding="UTF-8" location="classpath:/autorechrage.properties"/>
<beans profile="master1-test">
<context:property-placeholder ignore-unresolvable="false"
file-encoding="UTF-8"
location="classpath:/master1.test.properties"/>
</beans>
尽管autorechrage.properties不区分环境,但是如果分开读取,会导致master1.test.properties内容无法被@Value("${}")获得