Filter specific packages in @ComponentScan
You simply need to create two Config classes, for the two @ComponentScan annotations that you require. So for example you would have one Config class for your foo.bar package: @Configuration @ComponentScan(basePackages = {“foo.bar”}, excludeFilters = @ComponentScan.Filter(value = Service.class, type = FilterType.ANNOTATION) ) public class FooBarConfig { } and then a 2nd Config class for your … Read more