我有一个Spring应用程序,它的运行良好。现在我想要外部配置文件夹中的属性文件,而不是在打包的jar文件中进行更改,而不需要重新打包。这是我得到了什么:Spring应用程序上下文外部属性?
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<!-- <property name="locations" value="classpath:/springcontext.properties"/> -->
<property name="locations" value ="config/springcontext.properties" />
的outcommented一个正在工作,另一个我不上班:/有人能帮忙吗?
编辑: Thx目前为止4评论。
也许我的问题不够明确:)。我执行一个Maven构建,一切都将被打包,并且我希望此文件夹不在outcomming jar旁边的包装螺母中,并且在此文件夹中我想要属性文件。可能?
尝试用奇异'location',虽然'locations'应该管用。也可以尝试从类路径引用中删除前导'/'。 –
任何人都可以帮助解决新的问题? –
@DennisIch你是如何解决这个问题的?我正面临类似的问题 – happybuddha