本文主要是介绍SpringBoot的启动器——Spring-boot-starter介绍和常见启动器,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Spring Boot通过将我们常用的功能场景抽取出来,做成的一系列的启动器,我们只需要在项目中引入这些starter,相关的所有依赖就会全部被导入进来,并且我们可以抛弃繁杂的配置,例如:
Ø spring-boot-starter-web:支持全栈式的 web 开发,包括了 tomcat 和 springMVC 等 jar包
Ø spring-boot-starter-jpa:支持 spring 以 jpa方式操作数据库的 jar 包的集合
Ø spring-boot-starter-redis:支持 redis 键值存储的数据库操作
在导入的starter之后,SpringBoot主要帮我们完成了两件事情:
Ø 相关依赖的自动导入
Ø 相关环境的自动配置
2、Starters命名规范
-
官方启动器命名:
- 前缀:spring-boot-starter-
- 规范:spring-boot-starter-模块名
- 举例:spring-boot-starter-web、spring-boot-starter-jdbc
-
第三方启动器命名:
- 后缀:-spring-boot-starter
- 规范:模块名-spring-boot-starter
- 举例:mybatis-spring-boot-starter
3、Spring Boot提供的一些启动器(starter)
Spring Boot application starters
Name | Description | Pom |
---|---|---|
| Core starter, including auto-configuration support, logging and YAML | Pom |
| Starter for JMS messaging using Apache ActiveMQ | Pom |
| Starter for using Spring AMQP and Rabbit MQ | Pom |
| Starter for aspect-oriented programming with Spring AOP and AspectJ | Pom |
| Starter for JMS messaging using Apache Artemis | Pom |
| Starter for using Spring Batch | Pom |
| Starter for using Spring Framework’s caching support | Pom |
| Starter for using Spring Cloud Connectors which simplifies connecting to services in cloud platforms like Cloud Foundry and Heroku | Pom |
| Starter for using Cassandra distributed database and Spring Data Cassandra | Pom |
| Starter for using Cassandra distributed database and Spring Data Cassandra Reactive | Pom |
| Starter for using Couchbase document-oriented database and Spring Data Couchbase | Pom |
| Starter for using Couchbase document-oriented database and Spring Data Couchbase Reactive | Pom |
| Starter for using Elasticsearch search and analytics engine and Spring Data Elasticsearch | Pom |
| Starter for using Spring Data JDBC | Pom |
| Starter for using Spring Data JPA with Hibernate | Pom |
| Starter for using Spring Data LDAP | Pom |
| Starter for using MongoDB document-oriented database and Spring Data MongoDB | Pom |
| Starter for using MongoDB document-oriented database and Spring Data MongoDB Reactive | Pom |
| Starter for using Neo4j graph database and Spring Data Neo4j | Pom |
| Starter for using Redis key-value data store with Spring Data Redis and the Lettuce client | Pom |
| Starter for using Redis key-value data store with Spring Data Redis reactive and the Lettuce client | Pom |
| Starter for exposing Spring Data repositories over REST using Spring Data REST | Pom |
| Starter for using the Apache Solr search platform with Spring Data Solr | Pom |
| Starter for building MVC web applications using FreeMarker views | Pom |
| Starter for building MVC web applications using Groovy Templates views | Pom |
| Starter for building hypermedia-based RESTful web application with Spring MVC and Spring HATEOAS | Pom |
| Starter for using Spring Integration | Pom |
| Starter for using JDBC with the HikariCP connection pool | Pom |
| Starter for building RESTful web applications using JAX-RS and Jersey. An alternative to spring-boot-starter-web | Pom |
| Starter for using jOOQ to access SQL databases. An alternative to spring-boot-starter-data-jpa or spring-boot-starter-jdbc | Pom |
| Starter for reading and writing json | Pom |
| Starter for JTA transactions using Atomikos | Pom |
| Starter for JTA transactions using Bitronix | Pom |
| Starter for using Java Mail and Spring Framework’s email sending support | Pom |
| Starter for building web applications using Mustache views | Pom |
| Starter for using Spring Security’s OAuth2/OpenID Connect client features | Pom |
| Starter for using Spring Security’s OAuth2 resource server features | Pom |
| Starter for using the Quartz scheduler | Pom |
| Starter for using Spring Security | Pom |
| Starter for testing Spring Boot applications with libraries including JUnit, Hamcrest and Mockito | Pom |
| Starter for building MVC web applications using Thymeleaf views | Pom |
| Starter for using Java Bean Validation with Hibernate Validator | Pom |
| Starter for building web, including RESTful, applications using Spring MVC. Uses Tomcat as the default embedded container | Pom |
| Starter for using Spring Web Services | Pom |
| Starter for building WebFlux applications using Spring Framework’s Reactive Web support | Pom |
| Starter for building WebSocket applications using Spring Framework’s WebSocket support | Pom |
Spring Boot production starters
Name | Description | Pom |
---|---|---|
| Starter for using Spring Boot’s Actuator which provides production ready features to help you monitor and manage your application | Pom |
Spring Boot technical starters
Name | Description | Pom |
---|---|---|
| Starter for using Jetty as the embedded servlet container. An alternative to spring-boot-starter-tomcat | Pom |
| Starter for using Log4j2 for logging. An alternative to spring-boot-starter-logging | Pom |
| Starter for logging using Logback. Default logging starter | Pom |
| Starter for using Reactor Netty as the embedded reactive HTTP server. | Pom |
| Starter for using Tomcat as the embedded servlet container. Default servlet container starter used by spring-boot-starter-web | Pom |
| Starter for using Undertow as the embedded servlet container. An alternative to spring-boot-starter-tomcat | Pom |
这篇关于SpringBoot的启动器——Spring-boot-starter介绍和常见启动器的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!