springboot 系列教程二:常用starter介绍

原创
2019/04/13 11:22
阅读数 978

springboot非常的流行,就是因为starter的存在,starter是springboot的核心,可以理解成可插拔的插件,你想要什么插件配置什么插件就可以,比如我想要使用mybatis,那么配置starter-mybatis就可以。但是有人会说我用mybatis自己导入jar不行吗???实际上starter和jar区别在于,它能够自己实现配置,这样大大提高了开发效率,使得使用spring开发变得非常简单方便。

1. web starter

使用Spring MVC来构建RESTful Web应用,并使用Tomcat作为默认内嵌容器

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

2. data-jpa starter

使用基于Hibernate 的 Spring Data JPA

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

3. thymeleaf starter

在MVC应用中使用Trymeleaf渲染视图

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

4. spring-boot-starter

核心Spring Boot starter,包括自动配置支持,日志和YAML

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter</artifactId>
</dependency>

其他starter

名称 描述
spring-boot-starter-thymeleaf 使MVC Web applications 支持Thymeleaf
spring-boot-starter-mail 使用Java Mail、Spring email发送支持
spring-boot-starter-data-redis 通过Spring Data Redis 、Jedis client使用Redis键值存储数据库
spring-boot-starter-web 构建Web,包含RESTful风格框架SpringMVC和默认的嵌入式容器Tomcat
spring-boot-starter-activemq 为JMS使用Apache ActiveMQ
spring-boot-starter-data-elasticsearch 使用Elasticsearch、analytics engine、Spring Data Elasticsearch
spring-boot-starter-aop 通过Spring AOP、AspectJ面向切面编程
spring-boot-starter-security 使用 Spring Security
spring-boot-starter-data-jpa 通过 Hibernate 使用 Spring Data JPA
spring-boot-starter Core starter,包括 自动配置支持、 logging and YAML
spring-boot-starter-freemarker 使MVC Web applications 支持 FreeMarker
spring-boot-starter-batch 使用Spring Batch
spring-boot-starter-data-solr 通过 Spring Data Solr 使用 Apache Solr
spring-boot-starter-data-mongodb 使用 MongoDB 文件存储数据库、Spring Data MongoDB
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
5
分享
返回顶部
顶部