Spring Boot起步依赖大大简化了项目构建说明中的依赖配置,因为常用的依赖聚合于更粗粒度的依赖。你的构建项目会传递解析到起步依赖中声明的其他依赖。
起步依赖不仅能让构建说明中的依赖配置更简单,还根据提供给应用程序的功能将它们组织到一起。例如,与其指定用于验证的特定库(比如Hibernate Validator和Tomcat的内嵌表达式语言),还不如简单地添加spring-boot-starter-validation
起步依赖。
表B-1列出了Spring Boot的所有起步依赖,还有它们传递声明的依赖。
表B-1 Spring Boot起步依赖
起步依赖(Group ID:org.springframework.boot
)
传递依赖
spring-boot-starter
• org.springframework.boot:spring-boot
• org.springframework.boot:spring-boot-autoconfigure
• org.springframework.boot:spring-boot-starter-
logging
• org.springframework:spring-core
(excludes commons-logging:commons-logging)
• org.yaml:snakeyaml
spring-boot-starter-
actuator
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-actuator
spring-boot-starter-
amqp
• org.springframework.boot:spring-boot-starter
• org.springframework:spring-messaging
• org.springframework.amqp:spring-rabbit
spring-boot-starter-
aop
• org.springframework.boot:spring-boot-starter
• org.springframework:spring-aop
• org.aspectj:aspectjrt
• org.aspectj:aspectjweaver
spring-boot-starter-
artemis
• org.springframework.boot:spring-boot-starter
• org.springframework:spring-jms
• org.apache.activemq:artemis-jms-client
spring-boot-starter-
batch
• org.springframework.boot:spring-boot-starter
• org.hsqldb:hsqldb
• org.springframework:spring-jdbc
• org.springframework.batch:spring-batch-core
spring-boot-starter-
cache
• org.springframework.boot:spring-boot-starter
• org.springframework:spring-context
• org.springframework:spring-context-support
spring-boot-starter-
cloud-connectors
• org.springframework.boot:spring-boot-starter
• org.springframework.cloud:spring-cloud-spring-
service-connector
• org.springframework.cloud:spring-cloud-
cloudf-oundry-connector
• org.springframework.cloud:spring-cloud-
heroku-connector
• org.springframework.cloud:spring-cloud-
local-config-connector
spring-boot-starter-
data-elasticsearch
• org.springframework.boot:spring-boot-starter
• org.springframework.data:spring-data-elasticsearch
spring-boot-starter-
data-gemfire
• org.springframework.boot:spring-boot-starter
• com.gemstone.gemfire:gemfire(excludes commons-
logging:commons-logging)
• org.springframework.data:spring-data-gemfire
spring-boot-starter-
data-jpa
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-aop
• org.springframework.boot:spring-boot-starter-jdbc
• org.hibernate:hibernate-entitymanager
(excludes_org.jboss.spec.javax.transaction:jboss-
transaction-api_1.2_spec)
• javax.transaction:javax.transaction-api
• org.springframework.data:spring-data-jpa
• org.springframework:spring-aspects
spring-boot-starter-
data-mongodb
• org.springframework.boot:spring-boot-starter
• org.mongodb:mongo-java-driver
• org.springframework.data:spring-data-mongodb
spring-boot-starter-
data-rest
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• com.fasterxml.jackson.core:jackson-annotations
• com.fasterxml.jackson.core:jackson-databind
• org.springframework.data:spring-data-rest-webmvc
spring-boot-starter-
data-solr
• org.springframework.boot:spring-boot-starter
• org.apache.solr:solr-solrj (excludes log4j:log4j)
• org.springframework.data:spring-data-solr
• org.apache.httpcomponents:httpmime
spring-boot-starter-
freemarker
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• org.freemarker:freemarker
• org.springframework:spring-context-support
spring-boot-starter-
groovy-templates
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• org.codehaus.groovy:groovy-templates
spring-boot-starter-
hateoas
• org.springframework.boot:spring-boot-starter-web
• org.springframework.hateoas:spring-hateoas
• org.springframework.plugin:spring-plugin-core
spring-boot-starter-
hornetq
• org.springframework.boot:spring-boot-starter
• org.springframework:spring-jms
• org.hornetq:hornetq-jms-client
spring-boot-starter-
integration
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-aop
• org.springframework.integration:spring-
integration-core
• org.springframework.integration:spring-
integration-file
• org.springframework.integration:spring-
integration-http
• org.springframework.integration:spring-
integration-ip
• org.springframework.integration:spring-
integration-stream
spring-boot-starter-
jdbc
• org.springframework.boot:spring-boot-starter
• org.apache.tomcat:tomcat-jdbc
• org.springframework:spring-jdbc
spring-boot-starter-
jersey
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-
tomcat
• org.springframework.boot:spring-boot-starter-
validation
• com.fasterxml.jackson.core:jackson-databind
• org.springframework:spring-web
• org.glassfish.jersey.core:jersey-server
• org.glassfish.jersey.containers:jersey-container-
servlet-core
• org.glassfish.jersey.containers:jersey-container-
servlet
• org.glassfish.jersey.ext:jersey-bean-validation
(excludes javax.el:javax.el-api, org.glassfish.web:
javax.el)
• org.glassfish.jersey.ext:jersey-spring3
• org.glassfish.jersey.media:jersey-media-json-jackson
spring-boot-starter-
jetty
• org.eclipse.jetty:jetty-servlets
• org.eclipse.jetty:jetty-webapp
• org.eclipse.jetty.websocket:websocket-server
• org.eclipse.jetty.websocket:javax-websocket-
server-impl
spring-boot-starter-
jooq
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-jdbc
• org.springframework:spring-tx
• org.jooq:jooq
spring-boot-starter-
jta-atomikos
• org.springframework.boot:spring-boot-starter
• com.atomikos:transactions-jms
• com.atomikos:transactions-jta
(excludes org.apache.geronimo.specs:geronimo-
jta_1.0.1B_spec)
• com.atomikos:transactions-jdbc
• javax.transaction:javax.transaction-api
spring-boot-starter-
jta-bitronix
• org.springframework.boot:spring-boot-starter
• javax.jms:jms-api
• javax.transaction:javax.transaction-api
• org.codehaus.btm:btm (excludes javax.transaction:
jta)
spring-boot-starter-
log4j
• org.slf4j:jcl-over-slf4j
• org.slf4j:jul-to-slf4j
• org.slf4j:slf4j-log4j12
• log4j:log4j
spring-boot-starter-
log4j2
• org.apache.logging.log4j:log4j-slf4j-impl
• org.apache.logging.log4j:log4j-api
• org.apache.logging.log4j:log4j-core
• org.slf4j:jcl-over-slf4j
• org.slf4j:jul-to-slf4j
spring-boot-starter-
logging
• ch.qos.logback:logback-classic
• org.slf4j:jcl-over-slf4j
• org.slf4j:jul-to-slf4j
• org.slf4j:log4j-over-slf4j
spring-boot-starter-
mail
• org.springframework.boot:spring-boot-starter
• org.springframework:spring-context
• org.springframework:spring-context-support
• com.sun.mail:javax.mail
spring-boot-starter-
mobile
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• org.springframework.mobile:spring-mobile-device
spring-boot-starter-
mustache
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• com.samskivert:jmustache
spring-boot-starter-
redis
• org.springframework.boot:spring-boot-starter
• org.springframework.data:spring-data-redis
• redis.clients:jedis
spring-boot-starter-
remote-shell
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-
actuator
• org.crashub:crash.cli
• org.crashub:crash.connectors.ssh(excludes org.
codehaus.groovy:groovy-all)
•org.crashub:crash.connectors.telnet (excludes javax.
servlet:servlet-api,log4j:log4j,commons-logging:
commonslogging)
• org.crashub:crash.embed.spring(excludes org.spring-
framework:spring-web,org.codehaus.groovy:groovy-all)
• org.crashub:crash.plugins.cron (excludes org.
codehaus.groovy:groovy-all)
• org.crashub:crash.plugins.mail (excludes org.
codehaus.groovy:groovy-all)
• org.crashub:crash.shell(excludes org.codehaus.
groovy:groovy-all)
• org.codehaus.groovy:groovy
spring-boot-starter-
security
• org.springframework.boot:spring-boot-starter
• org.springframework:spring-aop
•org.springframework.security:spring-security-config
• org.springframework.security:spring-security-web
spring-boot-starter-
social-facebook
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• org.springframework.social:spring-social-config
• org.springframework.social:spring-social-core
• org.springframework.social:spring-social-web
• org.springframework.social:spring-social-facebook
spring-boot-starter-
social-linkedin
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• org.springframework.social:spring-social-config
• org.springframework.social:spring-social-core
• org.springframework.social:spring-social-web
• org.springframework.social:spring-social-linkedin
spring-boot-starter-
social-twitter
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• org.springframework.social:spring-social-config
• org.springframework.social:spring-social-core
• org.springframework.social:spring-social-web
• org.springframework.social:spring-social-twitter
spring-boot-starter-
tes
• junit:junit
• org.mockito:mockito-core
• org.hamcrest:hamcrest-core
• org.hamcrest:hamcrest-library
• org.springframework:spring-core(excludes commons-
logging:commons-logging)
• org.springframework:spring-test
spring-boot-starter-
thymeleaf
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• org.thymeleaf:thymeleaf-spring4
• nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect
spring-boot-starter-
tomcat
• org.apache.tomcat.embed:tomcat-embed-core
• org.apache.tomcat.embed:tomcat-embed-el
• org.apache.tomcat.embed:tomcat-embed-logging-juli
• org.apache.tomcat.embed:tomcat-embed-websocket
spring-boot-starter-
undertow
• io.undertow:undertow-core
•io.undertow:undertow-servlet(excludes org.jboss.
spec.javax.servlet:jboss-servlet-api_3.1_spec)
• io.undertow:undertow-websockets-jsr
• javax.servlet:javax.servlet-api
• org.glassfish:javax.el
spring-boot-starter-
validation
• org.springframework.boot:spring-boot-starter
• org.apache.tomcat.embed:tomcat-embed-el
• org.hibernate:hibernate-validator
spring-boot-starter-
velocity
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• commons-beanutils:commons-beanutils
• commons-collections:commons-collections
• commons-digester:commons-digester
• org.apache.velocity:velocity
• org.apache.velocity:velocity-tools
• org.springframework:spring-context-support
spring-boot-starter-
web
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-
tomcat
• org.springframework.boot:spring-boot-starter-
validation
• com.fasterxml.jackson.core:jackson-databind
• org.springframework:spring-web
• org.springframework:spring-webmvc
spring-boot-starter-
websocket
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• org.springframework:spring-messaging
• org.springframework:spring-websocket
spring-boot-starter-
ws
• org.springframework.boot:spring-boot-starter
• org.springframework.boot:spring-boot-starter-web
• org.springframework:spring-jms
• org.springframework:spring-oxm
• org.springframework.ws:spring-ws-core
• org.springframework.ws:spring-ws-support