Starters简介

​ 启动器是一组方便的依赖关系描述符,您可以在应用程序中包含这些描述符。您可以获得所需的所有Spring和相关技术的一站式服务,而无需查看示例代码和复制粘贴依赖描述符的负载。例如,如果要开始使用Spring和JPA进行数据库访问,请spring-boot-starter-data-jpa在项目中包含依赖项。

启动器包含许多依赖项,这些依赖项是使项目快速启动和运行所需的依赖项,以及一组受支持的托管传递依赖项。

什么是名字

所有官方首发都遵循类似的命名模式; spring-boot-starter-*,这里*是特定类型的应用程序。此命名结构旨在帮助您找到启动器。许多IDE中的Maven集成允许您按名称搜索依赖项。例如,安装了适当的Eclipse或STS插件后,您可以ctrl-space在POM编辑器中输入“spring-boot-starter”以获取完整列表。

第三方启动者不应该开头为spring-boot,因为它是为官方Spring Boot工件保留的。相反,第三方启动器通常以项目名称开头。例如,thirdpartyproject通常会命名一个名为的第三方启动项目 thirdpartyproject-spring-boot-starter

以下应用程序启动程序由Spring Boot在org.springframework.boot组下提供 :

名称 描述
spring-boot-starter 核心启动器,包括自动配置支持,日志记录和YAML
spring-boot-starter-activemq Apache ActiveMQ进行JMS消息传递
spring-boot-starter-amqp Spring AMQP和Rabbit MQ
spring-boot-starter-aop Spring AOP和AspectJ进行面向方面编程
spring-boot-starter-artemis Apache Artemis进行JMS消息传递
spring-boot-starter-batch Spring Batch
spring-boot-starter-cache Spring Framework的缓存支持
spring-boot-starter-cloud-connectors Spring Cloud Connectors的启动器,简化了Cloud Foundry和Heroku等云平台中的服务连接
spring-boot-starter-data-cassandra Cassandra分布式数据库和Spring Data Cassandra
spring-boot-starter-data-cassandra-reactive Cassandra分布式数据库和Spring Data Cassandra Reactive
spring-boot-starter-data-couchbase Couchbase面向文档的数据库和Spring Data Couchbase
spring-boot-starter-data-couchbase-reactive Couchbase面向文档的数据库和Spring Data Couchbase Reactive
spring-boot-starter-data-elasticsearch Elasticsearch搜索和分析引擎以及Spring Data Elasticsearch
spring-boot-starter-data-jdbc Spring Data JDBC
spring-boot-starter-data-jpa 将Spring Data JPA与Hibernate一起使用
spring-boot-starter-data-ldap Spring Data LDAP
spring-boot-starter-data-mongodb MongoDB面向文档的数据库和Spring Data MongoDB
spring-boot-starter-data-mongodb-reactive MongoDB面向文档的数据库和Spring Data MongoDB Reactive
spring-boot-starter-data-neo4j Neo4j图形数据库和Spring Data Neo4j
spring-boot-starter-data-redis 在Spring Data Redis和Lettuce客户端上使用Redis键值数据存储
spring-boot-starter-data-redis-reactive 带有Spring Data Redis被动的Redis键值数据存储和Lettuce客户端
spring-boot-starter-data-rest Spring Data REST通过REST公开Spring Data存储库
spring-boot-starter-data-solr 在Spring Data Solr中使用Apache Solr搜索平台
spring-boot-starter-freemarker FreeMarker视图构建MVC Web应用程序
spring-boot-starter-groovy-templates Groovy模板视图构建MVC Web应用程序
spring-boot-starter-hateoas Spring MVC和Spring HATEOAS构建基于超媒体的RESTful Web应用程序
spring-boot-starter-integration Spring Integration
spring-boot-starter-jdbc 将JDBC与HikariCP连接池一起使用
spring-boot-starter-jersey JAX-RS和Jersey构建RESTful Web应用程序,替代spring-boot-starter-web
spring-boot-starter-jooq jOOQ访问SQL数据库的启动器。替代spring-boot-starter-data-jpa或spring-boot-starter-jdbc
spring-boot-starter-json 阅读和写作json
spring-boot-starter-jta-atomikos Atomikos进行JTA交易
spring-boot-starter-jta-bitronix Bitronix进行JTA事务
spring-boot-starter-mail Java Mail和Spring Framework的电子邮件发送支持
spring-boot-starter-mustache Mustache视图构建Web应用程序
spring-boot-starter-oauth2-client Spring Security的OAuth2 / OpenID Connect客户端功能
spring-boot-starter-oauth2-resource-server Spring Security的OAuth2资源服务器功能
spring-boot-starter-quartz Quartz调度程序
spring-boot-starter-security Spring Security
spring-boot-starter-test JUnit,Hamcrest和Mockito等库来测试Spring Boot应用程序
spring-boot-starter-thymeleaf Thymeleaf视图构建MVC Web应用程序
spring-boot-starter-validation Java Bean Validation和Hibernate Validator
spring-boot-starter-web Spring MVC构建Web(包括RESTful)应用程序的启动器。使用Tomcat作为默认嵌入式容器
spring-boot-starter-web-services Spring Web Services
spring-boot-starter-webflux Spring Framework的Reactive Web支持构建WebFlux应用程序
spring-boot-starter-websocket Spring Framework的WebSocket支持构建WebSocket应用程序

生产模块功能:

名称 描述
spring-boot-starter-actuator Spring Boot的Actuator的启动器,它提供生产就绪功能,帮助您监控和管理您的应用程序

最后,如果要排除或交换特定的技术方面,Spring Boot还包括以下启动器:

名称 描述
spring-boot-starter-jetty Jetty作为嵌入式servlet容器,替代spring-boot-starter-tomcat
spring-boot-starter-log4j2 Log4j2进行日志记录。替代spring-boot-starter-logging
spring-boot-starter-logging Logback进行日志记录。默认日志启动器
spring-boot-starter-reactor-netty Reactor Netty作为嵌入式响应式HTTP服务器
spring-boot-starter-tomcat Tomcat作为嵌入式servlet容器。使用的默认servlet容器启动器spring-boot-starter-web
spring-boot-starter-undertow Undertow作为嵌入式servlet容器。替代spring-boot-starter-tomcat