Java Spring中的默认和生产配置
我在类路径中有默认的应用程序属性。如果存在,我需要从文件的外部属性重写它 现在加载属性似乎如下所示:Java Spring中的默认和生产配置,java,spring,properties,Java,Spring,Properties,我在类路径中有默认的应用程序属性。如果存在,我需要从文件的外部属性重写它 现在加载属性似乎如下所示: <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:some-configur
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:some-configuration.properties</value>
<!--...-->
</list>
</property>
</bean>
classpath:some-configuration.properties
有什么方法可以做到这一点吗?向bean添加属性
<property name="ignoreResourceNotFound" value="true" />
并在位置中指定外部属性文件
<value>file:/env/another-configurations.properties</value>
文件:/env/other-configurations.properties
也许这对@hasnae有帮助谢谢,对我很有用