自定义properties bean,如下:
@Configuration public class ConfigProperties { @Bean public static PropertySourcesPlaceholderConfigurer properties() { PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer(); YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean(); yaml.setResources(new ClassPathResource("config/busiConfig.yml"),new ClassPathResource("config/Rocketmq.yml")); configurer.setProperties(yaml.getObject()); return configurer; } }
转载于:https://www.cnblogs.com/ligh-test/p/10752072.html
最后
以上就是眼睛大期待最近收集整理的关于springboot配置多个yml文件的全部内容,更多相关springboot配置多个yml文件内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复