SpringBoot配置类编写

1、编写properties文件
SpringBoot配置类编写

2、编写配置类
SpringBoot配置类编写

3、编译项目将target\classes\META-INF\spring-configuration-metadata.json文件copy到resources\META-INF目录
这样以达到配置文件中自动提示配置项
SpringBoot配置类编写

4、配置文件中配置
SpringBoot配置类编写

5、其他类中可自动注入使用

猜你喜欢

转载自blog.51cto.com/handsomebingli/2446936