1、@SpringBootApplication注解中的exclude只能排除自动配置的类,例如:
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
2、@ComponentScan注解中的excludeFilters才是排除自定义配置类的正确方式,例如:
@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {DefaultDruidConfig.class}))
网友评论