1.@SpringBootApplication
用在 springboot 的核心主类上,最最重要的注解,标识是一个 springboot 应用,开启springboot 的各项应用.相当于@SpringBootConfiguration,@EnableAutoConfiguration,@ComponentScan 三个注解的组合.
2. @ComponentScan 用来代替配置文件中的comment-scan配置,用来开启组件扫描,自动扫描@Comment 注解自动注册 bean 到context
3. @SpringBootConfiguration @Configuration
注解的变体, @Configuration
是Spring 3.0 添加的一个注解,用来代替 applicationContext.xml 配置文件.
4. @EnableAutoConfiguration Spring Boot 就能根据当前类路径下的包或者类来配置 Spring Bean
参考文献: