@SpringBootApplication注解,分为哪三个注解,详细说明下?
- 1、@SpringBootConfiguration:该注解表示该类是Spring Boot应用程序的配置类,它会被Spring Boot自动识别并加载配置。是@Configuration注解的特殊形式,标注当前类是配置类(会在当前类内生命一个或多个以@Bean注解标记的方法实例纳入到Spring容器中。)
- 2、@EnableAutoConfiguration:该注解表示开启Spring Boot的自动配置,这个注解会告诉Spring Boot根据classpath中的依赖及配置自动配置它认为我们会用到的组件。
- 3、@ComponentScan:该注解表示启用组件扫描,自动扫描和注册带有@Component、@Service、@Controller等注解的组件类。