根據jar包進行排除過濾
@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX,
pattern = {"com.sample.*","com.demo.*"}))
根據類進行過濾
@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,
classes = {RedissonConfig.class}))
@Filters指過濾規則,FilterType指定過濾的規則:
FilterType.ANNOTATION:按照註解
FilterType.ASSIGNABLE_TYPE:按照給定的類型
FilterType.ASPECTJ:使用ASPECTJ表達式
FilterType.REGEX:使用正則指定
FilterType.CUSTOM:使用自定義規則