【发布时间】:2016-11-23 08:59:31
【问题描述】:
在我的 spring 项目中,我有两个具有相同属性的不同 conf 文件。
其中一个在外部目录中,而另一个在我项目的资源中。
我希望外部文件的属性覆盖内部值(如果它们存在于外部文件中)。
在我的配置类中,我使用 PropertySource 注释设置文件:
@PropertySources(
{ @PropertySource("file:${HOME}/conf/application.properties"),
@PropertySource("classpath:/data.properties")
})
【问题讨论】:
标签: java spring spring-boot