Spring Boot的特点是自动化配置依赖模块,提供的一系列starter脚手架便于使用,充分体现了“开箱即用”和“约定优于配置”。

 

命名规则:

Spring Boot提供的starter命名规则为spring-boot-starter-*,*号是某类应用程序,比如spring-boot-starter-web

自定义或者第三方提供的starter命名规则为*-spring-boot-starter,*号是第三方项目名称,比如mybatis-spring-boot-starter


常用Spring Boot Starter

名称

功能

spring-boot-starter

支持自动配置,YAML

spring-boot-starter-web

Web和REST接口开发,默认Web容器Tomcat,端口8080

spring-boot-starter-websocket

WebSocket长连接应用开发

spring-boot-starter-security

使用Spring Security安全访问控制

spring-boot-starter-aop

引入AOP面向切面编程AspectJ

spring-boot-starter-cache

Spring caching缓存框架

spring-boot-starter-jdbc

JDBC 连接池

spring-boot-starter-data-jpa

JPA,默认Hibernate

spring-boot-starter-data-mongodb

使用MongoDB

spring-boot-starter-data-redis

使用Redis和Jedis客户端

spring-boot-starter-data-solr

使用Apache Solr搜索服务

spring-boot-starter-data-elasticsearch

集成Elasticsearch

spring-boot-starter-activemq

使用Apache ActiveMQ消息队列

spring-boot-starter-amqp

使用Spring AMQP、Rabbit MQ消息队列

spring-boot-starter-quartz

引入定时任务调度

spring-boot-starter-mail

使用Java Mail、Spring email发送邮件

spring-boot-starter-logging

日志,默认Logback

spring-boot-starter-test

引入JUnit, Mockito等测试工具

spring-boot-devtools

辅助工具,程序快速启动

常用第三方脚手架:

名称

功能

mybatis-spring-boot-starter    

引入MyBatis

druid-spring-boot-starter    

阿里Druid连接池

docker-api-spring-boot-starter    

Docker客户端

 

Github代码:https://github.com/spring-projects/spring-boot/tree/master/spring-boot-project/spring-boot-starters

参考文档:https://blog.csdn.net/u014430366/article/details/53648139

官网文档: https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-starter