SpringBoot 之Spring Boot Starter依赖包及作用

Spring Boot 之Spring Boot Starter依赖包及作用

1、spring-boot-starter
这是Spring Boot的核心启动器,包含了自动配置、日志和YAML文件

2、spring-boot-starter-amqp
通过spring-rabbit来支持AMQP协议(Advanced Message Queuing Protocol)

3、spring-boot-starter-aop
支持面向方面的编程即AOP,包括spring-aop和AspectJ

4、spring-boot-starter-artemis
通过Apache Artemis支持JMS的API(Java Message Service API)

5、spring-boot-starter-batch
支持Spring Batch,包括HSQLDB数据库

6、spring-boot-starter-cache
支持Spring的Cache抽象

7、spring-boot-starter-cloud-connectors
支持Spring Cloud Connectors,简化了在Cloud Foundry或Heroku这样的云平台上连接服务

8、spring-boot-starter-data-elasticsearch
支持ElasticSearch搜索和分析引擎,包括spring-data-elasticsearch

9、spring-boot-starter-data-gemfire
支持GemFire分布式数据存储,包括spring-data-gemfire

10、spring-boot-starter-data-jpa
支持JPA(Java Persistence API. ,包括spring-data-jpa、spring-orm、Hibernate

11、spring-boot-starter-data-mongodb
支持MongoDB数据,包括spring-data-mongodb

12、spring-boot-starter-data-rest
通过spring-data-rest-webmvc,支持通过REST暴露Spring Data数据仓库

13、spring-boot-starter-data-solr
支持Apache Solr搜索平台,包括spring-data-solr

14、spring-boot-starter-freemarker
支持FreeMarker模板引擎

15、spring-boot-starter-groovy-templates
支持Groovy模板引擎

16、spring-boot-starter-hateoas
通过spring-hateoas支持基于HATEOAS的RESTful Web服务

17、spring-boot-starter-hornetq
通过HornetQ支持JMS

18、spring-boot-starter-integration
支持通用的spring-integration模块

19、spring-boot-starter-jdbc
支持JDBC数据库

20、spring-boot-starter-jersey
支持Jersey RESTful Web服务框架

21、spring-boot-starter-jta-atomikos
通过Atomikos支持JTA分布式事务处理

22、spring-boot-starter-jta-bitronix
通过Bitronix支持JTA分布式事务处理

23、spring-boot-starter-mail
支持javax.mail模块

24、spring-boot-starter-mobile
支持spring-mobile

25、spring-boot-starter-mustache
支持Mustache模板引擎

26、spring-boot-starter-redis
支持Redis键值存储数据库,包括spring-redis

27、spring-boot-starter-security
支持spring-security

28、spring-boot-starter-social-facebook
支持spring-social-facebook

29、spring-boot-starter-social-linkedin
支持pring-social-linkedin

30、spring-boot-starter-social-twitter
支持pring-social-twitter

31、spring-boot-starter-test
支持常规的测试依赖,包括JUnit、Hamcrest、Mockito以及spring-test模块

32、spring-boot-starter-thymeleaf
支持Thymeleaf模板引擎,包括与Spring的集成

33、spring-boot-starter-velocity
支持Velocity模板引擎

34、spring-boot-starter-web
支持全栈式Web开发,包括Tomcat和spring-webmvc

35、spring-boot-starter-websocket
支持WebSocket开发

36、spring-boot-starter-ws
支持Spring Web Services
Spring Boot应用启动器面向生产环境的还有2种,具体如下:

37、spring-boot-starter-actuator
增加了面向产品上线相关的功能,比如测量和监控

38、spring-boot-starter-remote-shell
增加了远程ssh shell的支持。
最后,Spring Boot应用启动器还有一些替换技术的启动器,具体如下:

39、spring-boot-starter-jetty
引入了Jetty HTTP引擎(用于替换Tomcat)

40、spring-boot-starter-log4j
支持Log4J日志框架

41、spring-boot-starter-logging
引入了Spring Boot默认的日志框架Logback

42、spring-boot-starter-tomcat
引入了Spring Boot默认的HTTP引擎Tomcat

43、spring-boot-starter-undertow
引入了Undertow HTTP引擎(用于替换Tomcat)

如果有新的依赖需要补充,可以在后台留言哦

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
spring-boot-starter-data-redis是Spring Boot提供的用于集成Redis的starter。它简化了在Spring Boot项目中集成Redis的配置和使用过程。下面是一个简单的演示: 1. 首先,在pom.xml文件中添加spring-boot-starter-data-redis依赖: ```xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> ``` 2. 在application.properties或application.yml文件中配置Redis连接信息: ```yaml spring.redis.host=127.0.0.1 spring.redis.port=6379 ``` 3. 创建一个RedisTemplate bean来操作Redis: ```java import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; @Component public class RedisExample { @Autowired private RedisTemplate<String, String> redisTemplate; public void setValue(String key, String value) { redisTemplate.opsForValue().set(key, value); } public String getValue(String key) { return redisTemplate.opsForValue().get(key); } } ``` 4. 在需要使用Redis的地方注入RedisExample bean,并使用它来操作Redis: ```java import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; @RestController public class ExampleController { @Autowired private RedisExample redisExample; @GetMapping("/redis/{key}") public String getValue(@PathVariable String key) { return redisExample.getValue(key); } @GetMapping("/redis/{key}/{value}") public void setValue(@PathVariable String key, @PathVariable String value) { redisExample.setValue(key, value); } } ``` 以上演示了如何在Spring Boot项目中集成spring-boot-starter-data-redis,并使用RedisTemplate来操作Redis。你可以根据自己的需求进行进一步的配置和使用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Rsun04551

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值