整理一下 Spring Boot 的起步依赖和对应的依赖包,按用途分类,可以用 Ctrl+F 查询。
版本:Spring Boot 1.3.8.RELEASE。表中 Starter 的 groupId 均为 org.springframework.boot。
右侧只列出 Starter 自身 POM 中声明的依赖,不继续展开下一级依赖。版本号和排除项未列出。
基础功能
| Starter | 直接依赖 |
|---|---|
spring-boot-starter | org.springframework.boot:spring-bootorg.springframework.boot:spring-boot-autoconfigureorg.springframework.boot:spring-boot-starter-loggingorg.springframework:spring-coreorg.yaml:snakeyaml |
spring-boot-starter-actuator | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-actuator |
spring-boot-starter-aop | org.springframework.boot:spring-boot-starterorg.springframework:spring-aoporg.aspectj:aspectjweaver |
spring-boot-starter-cache | org.springframework.boot:spring-boot-starterorg.springframework:spring-contextorg.springframework:spring-context-support |
spring-boot-starter-validation | org.springframework.boot:spring-boot-starterorg.apache.tomcat.embed:tomcat-embed-elorg.hibernate:hibernate-validator |
spring-boot-starter-test | junit:junitorg.mockito:mockito-coreorg.hamcrest:hamcrest-coreorg.hamcrest:hamcrest-libraryorg.springframework:spring-coreorg.springframework:spring-test |
spring-boot-starter-security | org.springframework.boot:spring-boot-starterorg.springframework:spring-aoporg.springframework.security:spring-security-configorg.springframework.security:spring-security-web |
Web 与模板
| Starter | 直接依赖 |
|---|---|
spring-boot-starter-web | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-tomcatorg.springframework.boot:spring-boot-starter-validationcom.fasterxml.jackson.core:jackson-databindorg.springframework:spring-weborg.springframework:spring-webmvc |
spring-boot-starter-websocket | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-weborg.springframework:spring-messagingorg.springframework:spring-websocket |
spring-boot-starter-ws | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-weborg.springframework:spring-jmsorg.springframework:spring-oxmorg.springframework.ws:spring-ws-coreorg.springframework.ws:spring-ws-support |
spring-boot-starter-jersey | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-tomcatorg.springframework.boot:spring-boot-starter-validationcom.fasterxml.jackson.core:jackson-databindorg.springframework:spring-weborg.glassfish.jersey.core:jersey-serverorg.glassfish.jersey.containers:jersey-container-servlet-coreorg.glassfish.jersey.containers:jersey-container-servletorg.glassfish.jersey.ext:jersey-bean-validationorg.glassfish.jersey.ext:jersey-spring3org.glassfish.jersey.media:jersey-media-json-jackson |
spring-boot-starter-hateoas | org.springframework.boot:spring-boot-starter-weborg.springframework.hateoas:spring-hateoasorg.springframework.plugin:spring-plugin-core |
spring-boot-starter-data-rest | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-webcom.fasterxml.jackson.core:jackson-annotationscom.fasterxml.jackson.core:jackson-databindorg.springframework.data:spring-data-rest-webmvc |
spring-boot-starter-freemarker | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-weborg.freemarker:freemarkerorg.springframework:spring-context-support |
spring-boot-starter-groovy-templates | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-weborg.codehaus.groovy:groovy-templates |
spring-boot-starter-thymeleaf | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-weborg.thymeleaf:thymeleaf-spring4nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect |
spring-boot-starter-mustache | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-webcom.samskivert:jmustache |
spring-boot-starter-velocity | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-webcommons-beanutils:commons-beanutilscommons-collections:commons-collectionscommons-digester:commons-digesterorg.apache.velocity:velocityorg.apache.velocity:velocity-toolsorg.springframework:spring-context-support |
spring-boot-starter-mobile | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-weborg.springframework.mobile:spring-mobile-device |
数据访问
| Starter | 直接依赖 |
|---|---|
spring-boot-starter-jdbc | org.springframework.boot:spring-boot-starterorg.apache.tomcat:tomcat-jdbcorg.springframework:spring-jdbc |
spring-boot-starter-data-jpa | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-aoporg.springframework.boot:spring-boot-starter-jdbcorg.hibernate:hibernate-entitymanagerjavax.transaction:javax.transaction-apiorg.springframework.data:spring-data-jpaorg.springframework:spring-aspects |
spring-boot-starter-jooq | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-jdbcorg.springframework:spring-txorg.jooq:jooq |
spring-boot-starter-redis | org.springframework.boot:spring-boot-starterorg.springframework.data:spring-data-redisredis.clients:jedis |
spring-boot-starter-data-mongodb | org.springframework.boot:spring-boot-starterorg.mongodb:mongo-java-driverorg.springframework.data:spring-data-mongodb |
spring-boot-starter-data-elasticsearch | org.springframework.boot:spring-boot-starterorg.springframework.data:spring-data-elasticsearch |
spring-boot-starter-data-solr | org.springframework.boot:spring-boot-starterorg.apache.solr:solr-solrjorg.springframework.data:spring-data-solrorg.apache.httpcomponents:httpmime |
spring-boot-starter-data-gemfire | org.springframework.boot:spring-boot-startercom.gemstone.gemfire:gemfireorg.springframework.data:spring-data-gemfire |
消息、批处理与集成
| Starter | 直接依赖 |
|---|---|
spring-boot-starter-amqp | org.springframework.boot:spring-boot-starterorg.springframework:spring-messagingorg.springframework.amqp:spring-rabbit |
spring-boot-starter-artemis | org.springframework.boot:spring-boot-starterorg.springframework:spring-jmsorg.apache.activemq:artemis-jms-client |
spring-boot-starter-hornetq | org.springframework.boot:spring-boot-starterorg.springframework:spring-jmsorg.hornetq:hornetq-jms-client |
spring-boot-starter-batch | org.springframework.boot:spring-boot-starterorg.hsqldb:hsqldborg.springframework:spring-jdbcorg.springframework.batch:spring-batch-core |
spring-boot-starter-integration | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-aoporg.springframework.integration:spring-integration-coreorg.springframework.integration:spring-integration-fileorg.springframework.integration:spring-integration-httporg.springframework.integration:spring-integration-iporg.springframework.integration:spring-integration-stream |
spring-boot-starter-mail | org.springframework.boot:spring-boot-starterorg.springframework:spring-contextorg.springframework:spring-context-supportcom.sun.mail:javax.mail |
spring-boot-starter-cloud-connectors | org.springframework.boot:spring-boot-starterorg.springframework.cloud:spring-cloud-spring-service-connectororg.springframework.cloud:spring-cloud-cloudfoundry-connectororg.springframework.cloud:spring-cloud-heroku-connectororg.springframework.cloud:spring-cloud-localconfig-connector |
spring-boot-starter-remote-shell | org.springframework.boot:spring-boot-starterorg.springframework.boot:spring-boot-starter-actuatororg.crashub:crash.cliorg.crashub:crash.connectors.sshorg.crashub:crash.connectors.telnetorg.crashub:crash.embed.springorg.crashub:crash.plugins.cronorg.crashub:crash.plugins.mailorg.crashub:crash.shellorg.codehaus.groovy:groovycom.sun.mail:javax.mail |
事务
| Starter | 直接依赖 |
|---|---|
spring-boot-starter-jta-atomikos | org.springframework.boot:spring-boot-startercom.atomikos:transactions-jmscom.atomikos:transactions-jtacom.atomikos:transactions-jdbcjavax.transaction:javax.transaction-api |
spring-boot-starter-jta-bitronix | org.springframework.boot:spring-boot-starterjavax.jms:jms-apijavax.transaction:javax.transaction-apiorg.codehaus.btm:btm |
内嵌容器
| Starter | 直接依赖 |
|---|---|
spring-boot-starter-tomcat | org.apache.tomcat.embed:tomcat-embed-coreorg.apache.tomcat.embed:tomcat-embed-elorg.apache.tomcat.embed:tomcat-embed-logging-juliorg.apache.tomcat.embed:tomcat-embed-websocket |
spring-boot-starter-jetty | org.eclipse.jetty:jetty-servletsorg.eclipse.jetty:jetty-webapporg.eclipse.jetty.websocket:websocket-serverorg.eclipse.jetty.websocket:javax-websocket-server-impl |
spring-boot-starter-undertow | io.undertow:undertow-coreio.undertow:undertow-servletio.undertow:undertow-websockets-jsrjavax.servlet:javax.servlet-apiorg.glassfish:javax.el |
日志
| Starter | 直接依赖 |
|---|---|
spring-boot-starter-logging | ch.qos.logback:logback-classicorg.slf4j:jcl-over-slf4jorg.slf4j:jul-to-slf4jorg.slf4j:log4j-over-slf4j |
spring-boot-starter-log4j | org.slf4j:jcl-over-slf4jorg.slf4j:jul-to-slf4jorg.slf4j:slf4j-log4j12log4j:log4j |
spring-boot-starter-log4j2 | org.apache.logging.log4j:log4j-slf4j-implorg.apache.logging.log4j:log4j-apiorg.apache.logging.log4j:log4j-coreorg.slf4j:jcl-over-slf4jorg.slf4j:jul-to-slf4j |
查看项目实际依赖
在项目根目录执行:
mvn dependency:tree只看 Spring Boot 相关依赖,可以加过滤条件:
mvn dependency:tree '-Dincludes=org.springframework.boot:*'Starter 的使用示例见 Spring Boot 之 Starter。