当我们的SpringBoot引用了别的SpringBoot项目并且不能修改其中的代码 但是不想使用其中某个@Configuration配置类中配置 想但单独排除某个配置类 可以在启动类加上
@SpringBootApplication(exclude = {CommonShiroConfig.class})
@ComponentScan(excludeFilters = {@ComponentScan.Filter(
type = FilterType.ASSIGNABLE_TYPE, classes = {WebConfigurer.class})}, basePackages = {"com.echohawk.cloud"})
其中classes中填写要排除的类
本文介绍如何在Spring Boot项目中排除特定的@Configuration配置类。通过在启动类上使用@SpringBootApplication(exclude={}
3375

被折叠的 条评论
为什么被折叠?



