在 spring 中发布加载属性文件
Issue loading properties file in spring
spring 应用上下文文件和 application.properties 文件位于:
src/main/resources/META-INF/spring
当我尝试加载属性文件时:
<context:property-placeholder local-override="true" location="classpath:/META_INF/spring/application.properties"/>
获取错误:
class path resource [META_INF/spring/application.properties] cannot be opened because it does not exist
我也试过:
<context:property-placeholder local-override="true" location="classpath:application.properties"/>
<context:property-placeholder local-override="true" location="application.properties"/>
尝试:
<context:property-placeholder local-override="true" location="classpath:/META-INF/spring/application.properties"/>
而不是:
<context:property-placeholder local-override="true" location="classpath:/META_INF/spring/application.properties"/>
spring 应用上下文文件和 application.properties 文件位于:
src/main/resources/META-INF/spring
当我尝试加载属性文件时:
<context:property-placeholder local-override="true" location="classpath:/META_INF/spring/application.properties"/>
获取错误:
class path resource [META_INF/spring/application.properties] cannot be opened because it does not exist
我也试过:
<context:property-placeholder local-override="true" location="classpath:application.properties"/>
<context:property-placeholder local-override="true" location="application.properties"/>
尝试:
<context:property-placeholder local-override="true" location="classpath:/META-INF/spring/application.properties"/>
而不是:
<context:property-placeholder local-override="true" location="classpath:/META_INF/spring/application.properties"/>