PrepZone Logo
PrepZone
Back to Spring Boot

Spring Boot · Medium

What is the difference between @ComponentScan and @EnableAutoConfiguration?

Spring BootAnnotations & ConfigCore AnnotationsAuto-ConfigurationSeniorStaff

Answer preview

@ComponentScan — scans your application's packages for classes annotated with @Component, @Service, @Repository, @Controller, @Configuration, etc. and registers them as beans. You control what is scanned.…