Spring boot—— Starter詳解

Starter POMs是可以包含到應用中的一個方便的依賴關係描述符集合。可以獲取所有spring及相關技術的一站式服務,不需要翻閱示例代碼,拷貝粘貼大量的依賴描述符。

  • Starter名字的含義:

    所有的starters遵循一個相似的命名模式: 
    spring-boot-starter-*, 
    在這裏*是一種特殊類型的應用程序。該命名結構就是爲了幫我們找到需要的starter。 
    在Eclipse中,在pom.xml編輯界面,可以通過右鍵單擊編輯界面任意地方,選擇Spring–>Edit Starters進行添加starter。 
    如下圖所示:

這裏寫圖片描述

  • 應用程序starters

    以下應用程序starters是Spring Boot在org.springframework.boot組下提供的:

Spring Boot application starters:
  • 1
名稱 描述
spring-boot-starter 核心Spring Boot starter,包括自動配置支持,日誌和YAML
spring-boot-starter-actuator 生產準備的特性,用於幫我們監控和管理應用
spring-boot-starter-amqp 對”高級消息隊列協議”的支持,通過spring-rabbit實現
spring-boot-starter-aop 對面向切面編程的支持,包括spring-aop和AspectJ
spring-boot-starter-batch 對Spring Batch的支持,包括HSQLDB數據庫
spring-boot-starter-cloud-connectors 對Spring Cloud Connectors的支持,簡化在雲平臺下(例如,Cloud Foundry 和Heroku)服務的連接
spring-boot-starter-data-elasticsearch 對Elasticsearch搜索和分析引擎的支持,包括spring-data-elasticsearch
spring-boot-starter-data-gemfire 對GemFire分佈式數據存儲的支持,包括spring-data-gemfire
spring-boot-starter-data-jpa 對”Java持久化API”的支持,包括spring-data-jpa,spring-orm和Hibernate
spring-boot-starter-data-mongodb 對MongoDB NOSQL數據庫的支持,包括spring-data-mongodb
spring-boot-starter-data-rest 對通過REST暴露Spring Data倉庫的支持,通過spring-data-rest-webmvc實現
spring-boot-starter-data-solr 對Apache Solr搜索平臺的支持,包括spring-data-solr
spring-boot-starter-freemarker 對FreeMarker模板引擎的支持
spring-boot-starter-groovy-templates 對Groovy模板引擎的支持
spring-boot-starter-hateoas 對基於HATEOAS的RESTful服務的支持,通過spring-hateoas實現
spring-boot-starter-hornetq 對”Java消息服務API”的支持,通過HornetQ實現
spring-boot-starter-integration 對普通spring-integration模塊的支持
spring-boot-starter-jdbc 對JDBC數據庫的支持
spring-boot-starter-jersey 對Jersey RESTful Web服務框架的支持
spring-boot-starter-jta-atomikos 對JTA分佈式事務的支持,通過Atomikos實現
spring-boot-starter-jta-bitronix 對JTA分佈式事務的支持,通過Bitronix實現
spring-boot-starter-mail 對javax.mail的支持
spring-boot-starter-mobile 對spring-mobile的支持
spring-boot-starter-mustache 對Mustache模板引擎的支持
spring-boot-starter-redis 對REDIS鍵值數據存儲的支持,包括spring-redis
spring-boot-starter-security 對spring-security的支持
spring-boot-starter-social-facebook 對spring-social-facebook的支持
spring-boot-starter-social-linkedin 對spring-social-linkedin的支持
spring-boot-starter-social-twitter 對spring-social-twitter的支持
spring-boot-starter-test 對常用測試依賴的支持,包括JUnit, Hamcrest和Mockito,還有spring-test模塊
spring-boot-starter-thymeleaf 對Thymeleaf模板引擎的支持,包括和Spring的集成
spring-boot-starter-velocity 對Velocity模板引擎的支持
spring-boot-starter-web 對全棧web開發的支持, 包括Tomcat和spring-webmvc
spring-boot-starter-websocket 對WebSocket開發的支持
spring-boot-starter-ws 對Spring Web服務的支持

  • 添加生產準備的starters:

    除了應用程序的starters,還有可以用於添加生產準備的starters(../V. Spring Boot Actuator/README.md)

    Spring Boot生產準備的starters

名稱 描述
spring-boot-starter-actuator 添加生產準備特性,比如指標和監控
spring-boot-starter-remote-shell 添加遠程ssh shell支持

  • 排除或交換具體技術方面的starters:
名稱 描述
spring-boot-starter-jetty 導入Jetty HTTP引擎(作爲Tomcat的替代)
spring-boot-starter-log4j 對Log4J日誌系統的支持
spring-boot-starter-logging 導入Spring Boot的默認日誌系統
spring-boot-starter-tomcat 導入Spring Boot的默認HTTP引擎
spring-boot-starter-undertow 導入Undertow HTTP引擎(作爲Tomcat的替代)
發佈了32 篇原創文章 · 獲贊 40 · 訪問量 17萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章