beginnerCore Annotations & Auto-Configuration

What exactly does `@SpringBootApplication` bundle together?

It's a meta-annotation combining three: `@Configuration` (this class can define beans), `@EnableAutoConfiguration` (turn on the classpath-conditional auto-config scanning), and `@ComponentScan` (scan this package and sub-packages for `@Component`/`@Service`/`@Repository`/`@Controller` classes). Understanding this matters because moving your main class to a different package can silently break component scanning for classes outside its scan radius.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to How would you exclude one specific auto-configuration class from being applied?← Back to all Spring Boot questions