includeFilters过滤器:指定包含某个路径或实体类
excludeFilters过滤器:指定不包含某路径或实体类
示例代码如下:
package com.tyyd.lifecallbacks.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Repository;
@Configuration
@ComponentScan(basePackages = "com.tyyd.lifecallbacks",
includeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "com.tyyd.lifecallbacks.dao.*"),
excludeFilters = @ComponentScan.Filter(Repository.class))
public class JavaConfig {
}