SpringBoot加载指定配置文件的几种配置方式
时间:2020-07-21 13:11:13
收藏:0
阅读:1016
@PropertySource+@Value(普通属性配置)
PropertySourcesPlaceholderConfigurer+YamlPropertiesFactoryBean(启动配置)
通过启动参数spring.config.name(启动配置)
--spring.config.name :配置配置文件前缀(默认的配置文件前缀为application)
通过启动参数spring.config.location(启动配置)
--spring.config.location :配置配置文件地址,多个文件用英文逗号隔开
原文:https://www.cnblogs.com/lyp-make/p/13353321.html
评论(0)