官方文档是这么描述的:
Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can “just run”.
We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration.
翻译是:
Spring Boot可以很简单的就创建一个你可以运行的独立的、生产级别的Spring应用系统。
我们可以使用Spring平台和第三方库快速的开始,很多的Spring Boot应用需要很少的配置。
Sprint Boot的理念是 “习惯优于配置”。
1)以jar包的形式独立运行Spring项目。 2)内嵌servlet容器。 3)提供starrter pom 来简化Maven依赖。 4)根据在类路径中的jar包,类为jar包里的类自动配置Bean,减少要使用的配置。 5)提供基于http,ssh,telnet对运行时项目进行监控。 6)无代码生成和xml配置。
@SpringApplication是Spring Boot的核心注解,是一个组合注解。
@SpringBootConfiguration //与Configuration一样,相当于xml的beans @EnableAutoConfiguration //自动加载jar的配置 //会自动扫描包路径下面的所有@Controller、@Service、@Repository、@Component 的类 @ComponentScan( excludeFilters = {@Filter( type = FilterType.CUSTOM, classes = {TypeExcludeFilter.class} ), @Filter( type = FilterType.CUSTOM, classes = {AutoConfigurationExcludeFilter.class} )} )