springboot的44種啓動器

啓動類與啓動器區別:

① 啓動類表示項目的啓動入口。

② 啓動器表示 jar 包的座標。

啓動類:springboot的啓動類的作用是啓動 Spring Boot 項目,是基於 Main 方法來運行的。注意:啓動類在啓動時會做註解掃描( @Controller 、@Service 、@Repository … … ),掃描位置爲同包或者子包下的註解,所以啓動類的位置應放於包的根下。

啓動器:SpringBoot將所有的功能場景都抽取出來,做成一個個的starter啓動器,只需要在項目裏面引入這些starter,相關場景的所有依賴都會導入到項目中來,要用什麼功能就導入什麼場景的starter啓動器在jar包管理上非常方便,最終實現一站式開發。

Spring Boot應用基本的啓動器一共有44種,具體如下:

1)spring-boot-starter 
這是Spring Boot的核心啓動器,包含了自動配置、日誌和YAML。

2)spring-boot-starter-actuator 
幫助監控和管理應用。

3)spring-boot-starter-amqp 
通過spring-rabbit來支持AMQP協議(Advanced Message Queuing Protocol)。

4)spring-boot-starter-aop 
支持面向方面的編程即AOP,包括spring-aop和AspectJ。

5)spring-boot-starter-artemis 
通過Apache Artemis支持JMS的API(Java Message Service API)。

6)spring-boot-starter-batch 
支持Spring Batch,包括HSQLDB數據庫。

7)spring-boot-starter-cache 
支持Spring的Cache抽象。

8)spring-boot-starter-cloud-connectors 
支持Spring Cloud Connectors,簡化了在像Cloud Foundry或Heroku這樣的雲平臺上連接服務。

9)spring-boot-starter-data-elasticsearch 
支持ElasticSearch搜索和分析引擎,包括spring-data-elasticsearch。

10)spring-boot-starter-data-gemfire 
支持GemFire分佈式數據存儲,包括spring-data-gemfire。

11)spring-boot-starter-data-jpa 
支持JPA(Java Persistence API),包括spring-data-jpa、spring-orm、Hibernate。

12)spring-boot-starter-data-mongodb 
支持MongoDB數據,包括spring-data-mongodb。

13)spring-boot-starter-data-rest 
通過spring-data-rest-webmvc,支持通過REST暴露Spring Data數據倉庫。

14)spring-boot-starter-data-solr 
支持Apache Solr搜索平臺,包括spring-data-solr。

15)spring-boot-starter-freemarker 
支持FreeMarker模板引擎。

16)spring-boot-starter-groovy-templates 
支持Groovy模板引擎。

17)spring-boot-starter-hateoas 
通過spring-hateoas支持基於HATEOAS的RESTful Web服務。

18)spring-boot-starter-hornetq 
通過HornetQ支持JMS。

19)spring-boot-starter-integration 
支持通用的spring-integration模塊。

20)spring-boot-starter-jdbc 
支持JDBC數據庫。

21)spring-boot-starter-jersey 
支持Jersey RESTful Web服務框架。

22)spring-boot-starter-jta-atomikos 
通過Atomikos支持JTA分佈式事務處理。

23)spring-boot-starter-jta-bitronix 
通過Bitronix支持JTA分佈式事務處理。

24)spring-boot-starter-mail 
支持javax.mail模塊。

25)spring-boot-starter-mobile 
支持spring-mobile。

26)spring-boot-starter-mustache 
支持Mustache模板引擎。

27)spring-boot-starter-redis 
支持Redis鍵值存儲數據庫,包括spring-redis。

28)spring-boot-starter-security 
支持spring-security。

29)spring-boot-starter-social-facebook 
支持spring-social-facebook

30)spring-boot-starter-social-linkedin 
支持pring-social-linkedin

31)spring-boot-starter-social-twitter 
支持pring-social-twitter

32)spring-boot-starter-test 
支持常規的測試依賴,包括JUnit、Hamcrest、Mockito以及spring-test模塊。

33)spring-boot-starter-thymeleaf 
支持Thymeleaf模板引擎,包括與Spring的集成。

34)spring-boot-starter-velocity 
支持Velocity模板引擎。

35)spring-boot-starter-web 
支持全棧式Web開發,包括Tomcat和spring-webmvc。

36)spring-boot-starter-websocket 
支持WebSocket開發。

37)spring-boot-starter-ws 
支持Spring Web Services。

Spring Boot應用啓動器面向生產環境的還有2種,具體如下:

1)spring-boot-starter-actuator 
增加了面向產品上線相關的功能,比如測量和監控。

2)spring-boot-starter-remote-shell 
增加了遠程ssh shell的支持。

最後,Spring Boot應用啓動器還有一些替換技術的啓動器,具體如下:

1)spring-boot-starter-jetty 
引入了Jetty HTTP引擎(用於替換Tomcat)。

2)spring-boot-starter-log4j 
支持Log4J日誌框架。

3)spring-boot-starter-logging 
引入了Spring Boot默認的日誌框架Logback。

4)spring-boot-starter-tomcat 
引入了Spring Boot默認的HTTP引擎Tomcat。

5)spring-boot-starter-undertow 
引入了Undertow HTTP引擎(用於替換Tomcat)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章