在启动类上加入 @ComponentScan 注解,并设置excludeFilters即可排除指定Bean初始化:
@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {OrderService.class, ProductService.class}))
在启动类上加入 @ComponentScan 注解,并设置excludeFilters即可排除指定Bean初始化:
@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {OrderService.class, ProductService.class}))