Bootstrapmedium0-2 years

What does @SpringBootApplication actually do?

It's a meta-annotation that composes three: @SpringBootConfiguration (a specialised @Configuration, so the class itself can declare @Bean methods), @EnableAutoConfiguration (turns on the conditional auto-configuration machinery), and @ComponentScan (scans the package the annotated class lives in, and everything below it, for @Component/@Service/@Repository/@Controller). That's also why the convention is to put the main class in the application's root package — anything outside it is invisible to component scanning by default.

The lesson behind it →
More on Bootstrap