@ComponentScan(basePackages = {"com.xxx"},includeFilters={@ComponentScan.Filter(type = FilterType.ANNOTATION,classes = {Service.class})},excludeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION,classes = Repository.class)})
以上includeFilters是指包含扫描;FilterType.ANNOTATION 指扫描规则,用的按注解方式,其实还有以下几种
FilterType.ANNOTATION:按注解
FilterType.ASSIGNABLE_TYPE:按给定类型
FilterType.ASPECTJ:使用ASPECTJ
FilterType.REGEX:使用正则