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

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-starterCore 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

转载于:https://my.oschina.net/zhoumj/blog/3036318

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值