The @SpringBootApplication Main Class
A single annotation that combines three others to bootstrap the entire application.
// @SpringBootApplication is shorthand for:
@Configuration
@EnableAutoConfiguration
@ComponentScan
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
- @Configuration — this class can declare @Bean methods
- @EnableAutoConfiguration — turns on classpath-based auto-configuration
- @ComponentScan — scans this package and sub-packages for @Component beans