Spring Boot: @SpringBootApplication is three annotations in one

It combines @Configuration, @EnableAutoConfiguration and @ComponentScan of the current package downwards.

Code
@SpringBootApplication
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }
}

// Equivalent to:
@Configuration
@EnableAutoConfiguration
@ComponentScan
public class App { }
Output
Component scanning starts at the class's own package.
A @Service in a sibling package is never found - a classic "bean not created" cause.
Advertisement

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-11