SpringBoot自动配置与@Enable方式配置
SpringBoot自动配置与@Enable方式配置
SpringBoot自动配置:
在resources目录下新建META-INF目录,创建spring.factories文件。
1 | |
1 | |
此种方式就可以实现SpringBoot的自动配置加载。
通过@Enable注解方式实现自动配置
1 | |
不要在spring.factories文件里配置加载类,不然SpringBoot就自动加载配置了
此时只需要在启动类上加上@EnableTest就可以实现加载配置类了
SpringBoot自动配置与@Enable方式配置
https://happyloves.cn/20221123/af4853386d96.html