一、Spring
@ComponentScan(basePackages = {"com.xl","com.ws"}, excludeFilters = {@ComponentScan.Filter(type = FilterType.REGEX, pattern = "com.xl.common.*")})
二、Spring Boot
从常规
@SpringBootApplication(scanBasePackages = {"com.xl", "com.ws"})
更改为
@SpringBootApplication
@ComponentScan(basePackages = {"com.xl","com.ws"}, excludeFilters = {@ComponentScan.Filter(type = FilterType.REGEX, pattern = "com.ws.common.*")})