啟動類上面的注解是@SpringBootApplication,他也是SpringBoot的核心注解,主要組合包含了以下3個注解:
@SpringBootConfiguration:組合了@Configuration注解,實現(xiàn)配置文件的功能;
@EnableAutoConfiguration:打開自動配置的功能,也可以關(guān)閉某個自動配置的選項,如關(guān)閉數(shù)據(jù)源自動配置的功能:
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class});
@ComponentScan:Spring組件掃描。