SpringBoot啟動(dòng)器Starters使用及原理解析
Starters是什么
Starters可以理解為啟動(dòng)器,它包含了一系列可以集成到應(yīng)用里面的依賴包,你可以一站式集成Spring及其他技術(shù),而不需要到處找示例代碼和依賴包。如你想使用Spring JPA訪問數(shù)據(jù)庫,只要加入spring-boot-starter-data-jpa啟動(dòng)器依賴就能使用了。
Starters命名規(guī)則
Spring Boot官方的啟動(dòng)器都是以spring-boot-starter-命名的,代表了一個(gè)特定的應(yīng)用類型。第三方的啟動(dòng)器不能以spring-boot開頭命名,它們都被Spring Boot官方保留。一般一個(gè)第三方的應(yīng)該這樣命名,像mybatis的mybatis-spring-boot-starter。
啟動(dòng)器種類
Spring Boot應(yīng)用啟動(dòng)器基本的一共有N(現(xiàn)知道的是44)種:具體如下:
spring-boot-starter 這是Spring Boot的核心啟動(dòng)器,包含了自動(dòng)配置、日志和YAML。spring-boot-starter-actuator 幫助監(jiān)控和管理應(yīng)用。spring-boot-starter-amqp 通過spring-rabbit來支持AMQP協(xié)議。spring-boot-starter-aop 支持面向方面的編程即AOP,包括spring-aop和AspectJ。spring-boot-starter-artemis 通過Apache Artemis支持JMS的API(Java Message Service API)。spring-boot-starter-batch 支持Spring Batch,包括HSQLDB數(shù)據(jù)庫。spring-boot-starter-cache 支持Spring的Cache抽象。spring-boot-starter-cloud-connectors 支持Spring Cloud Connectors,簡化了在像Cloud Foundry或Heroku這樣的云平臺(tái)上連接服務(wù)。spring-boot-starter-data-elasticsearch 支持ElasticSearch搜索和分析引擎,包括spring-data-elasticsearch。spring-boot-starter-data-gemfire 支持GemFire分布式數(shù)據(jù)存儲(chǔ),包括spring-data-gemfire。spring-boot-starter-data-jpa 支持JPA、包括spring-data-jpa、spring-orm、Hibernate。spring-boot-starter-data-mongodb 支持MongoDB數(shù)據(jù),包括spring-data-mongodb。spring-boot-starter-data-rest 支持通過REST暴露Spring Data數(shù)據(jù)倉庫。spring-boot-starter-data-solr 支持Apache Solr搜索平臺(tái),包括spring-data-solr。spring-boot-starter-freemarker 支持FreeMarker模板引擎。spring-boot-starter-groovy-templates 支持Groovy模板引擎。spring-boot-starter-hateoas 通過spring-hateoas支持基于HATEOAS的RESTful Web服務(wù)。spring-boot-starter-hornetq 通過HornetQ支持JMS。spring-boot-starter-integration 支持通用的spring-integration模塊。spring-boot-starter-jdbc 支持JDBC數(shù)據(jù)庫。spring-boot-starter-jersey 支持Jersey RESTful Web服務(wù)框架。spring-boot-starter-jta-atomikos 通過Atomikos支持JTA分布式事務(wù)處理。spring-boot-starter-jta-bitronix 通過Bitronix支持JTA分布式事務(wù)處理。spring-boot-starter-mail 支持javax.mail模塊。spring-boot-starter-mobile 支持spring-mobile。spring-boot-starter-mustache 支持Mustache模板引擎。spring-boot-starter-redis 支持Redis鍵值存儲(chǔ)數(shù)據(jù)庫,包括spring-redis。spring-boot-starter-security 支持spring-security。spring-boot-starter-social-facebook 支持spring-social-facebookspring-boot-starter-social-linkedin 支持pring-social-linkedinspring-boot-starter-social-twitter 支持pring-social-twitterspring-boot-starter-test 支持常規(guī)測試依賴,包括JUnit、Hamcrest、Mockito、spring-test模塊。spring-boot-starter-thymeleaf 支持Thymeleaf模板引擎,包括與Spring的集成。spring-boot-starter-velocity 支持Velocity模板引擎。spring-boot-starter-web 支持全棧式Web開發(fā),包括Tomcat和spring-webmvc。spring-boot-starter-websocket 支持WebSocket開發(fā)。spring-boot-starter-ws 支持Spring Web Services。
Spring Boot應(yīng)用啟動(dòng)器面向生產(chǎn)環(huán)境的還有2種,具體如下:
spring-boot-starter-actuator 增加了面向產(chǎn)品上線相關(guān)的功能,比如測量和監(jiān)控。spring-boot-starter-remote-shell 增加了遠(yuǎn)程ssh shell的支持。
最后,Spring Boot應(yīng)用啟動(dòng)器還有一些替換技術(shù)的啟動(dòng)器,具體如下:
spring-boot-starter-jetty 引入了Jetty HTTP引擎(用于替換Tomcat)。spring-boot-starter-log4j 支持Log4J日志框架。spring-boot-starter-logging 引入了Spring Boot默認(rèn)的日志框架Logback。spring-boot-starter-tomcat 引入了Spring Boot默認(rèn)的HTTP引擎Tomcat。spring-boot-starter-undertow 引入了Undertow HTTP引擎(用于替換Tomcat)。
以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。
相關(guān)文章:
1. python公司內(nèi)項(xiàng)目對(duì)接釘釘審批流程的實(shí)現(xiàn)2. Python 簡介3. Python本地及虛擬解釋器配置過程解析4. Notepad++如何配置python?配置python操作流程詳解5. Python 利用flask搭建一個(gè)共享服務(wù)器的步驟6. Python自動(dòng)化之定位方法大殺器xpath7. python用zip壓縮與解壓縮8. Python操作Excel工作簿的示例代碼(*.xlsx)9. Python importlib模塊重載使用方法詳解10. Python中Anaconda3 安裝gdal庫的方法
