注意事项如下:
1.注解的配置文件如果名称name字段重复,springboot会自动基于重复的配置文件进行扩展。
2.使用@PropertySource注解不要使用@EnableConfigProperties的方式载入容器,最好用@CompontenScan能扫描到的方式载入容器,可以参考:ConfigurationClassParser的doProcessConfigurationClass方法执行流程
注意事项如下:
1.注解的配置文件如果名称name字段重复,springboot会自动基于重复的配置文件进行扩展。
2.使用@PropertySource注解不要使用@EnableConfigProperties的方式载入容器,最好用@CompontenScan能扫描到的方式载入容器,可以参考:ConfigurationClassParser的doProcessConfigurationClass方法执行流程