I have a class which I want to exclude while component scanning. I am using the below code to do that but that doesn\'t seem to work although everything seems to be right
I had an issue when using @Configuration, @EnableAutoConfiguration and @ComponentScan when trying to exclude specific configuration classes, but it didn't work!
Eventually I solved the problem by using @SpringBootApplication, which according to Spring documentation does the same functionality as the three above in one annotation.
Another Tip is to try first without refining your package scan (without the basePackages filter).
@SpringBootApplication(exclude= {Foo.class})
public class MySpringConfiguration {}