劳动是唯一导向知识的道路。——萧伯纳
使用:
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,
value = {WillExludeBean.class, AnotherWillExludeBean.class})})
即可
这里还有其他的过滤类型
例如注解
@ComponentScan(excludeFilters = @Filter(
type = FilterType.ANNOTATION,
value = Service.class))
切面
@ComponentScan(includeFilters = @Filter(
type = FilterType.ASPECTJ,
pattern = "com.example..*Service+"))
正则
@ComponentScan(includeFilters = @Filter(
type = FilterType.REGEX,
pattern = "com\\.example\\..*Service"))