SpringBoot加载指定配置文件的几种配置方式
@PropertySource+@Value(普通属性配置)

PropertySourcesPlaceholderConfigurer+YamlPropertiesFactoryBean(启动配置)

通过启动参数spring.config.name(启动配置)

--spring.config.name :配置配置文件前缀(默认的配置文件前缀为application)
通过启动参数spring.config.location(启动配置)

--spring.config.location :配置配置文件地址,多个文件用英文逗号隔开

浙公网安备 33010602011771号