springboot中@SpringBootApplication包含的三个注解及其含义

@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(excludeFilters = {
		@Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
		@Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class) })
public @interface SpringBootApplication {
....
}

##@SpringBootConfiguration
读取配置文件,配置文件的路径是当前根目录(src/main/resources/application.yml等)
##EnableAutoConfiguration
开启自动配置,扫描当前的所有依赖的jar包,发现新的依赖出现将会将会根据依赖完各种自动配置(扫描start_web,自动配置内置tomcat默认路径、端口;依赖了rabbitmq,自动配置rabbitTemble)
##ComponetScan
属于Spring框架(@Component,@Service,@Controller,@Repository,@Entity),扫描范围默认情况下是启动类坐在的同名包及其子孙包

你可能感兴趣的:(SpringBoot)