【发布时间】:2018-06-12 14:56:49
【问题描述】:
如何在spring boot中加载多个外部配置属性文件。请在运行 jar 文件时找到以下命令以加载外部属性文件。 “java -jar -Dspring.config.location=myBootProject.jar” 就像我们添加一个或两个配置路径,但是当我们添加两个以上的配置时,我们将如何配置?
【问题讨论】:
-
你试过“@PropertySources({ @PropertySource("classpath:env1.properties"), @PropertySource("classpath:env2.properties") })”吗?或者您尝试使用“include = env1.properties include = env2.properties”在主属性文件中包含多个属性
标签: spring spring-boot properties-file