Autoconfiguration classes should not enable Component Scanning, as stated in the official Spring documentation.
See https://docs.spring.io/spring-boot/reference/features/developing-auto-configuration.html#features.developing-auto-configuration Note in paragraph “Location Auto-configuration Candidates”. The correct way should make use of @Import