https://blog.youkuaiyun.com/qq_26525215/article/details/79182687
集成Redis
首先在pom.xml中加入需要的redis依赖和缓存依赖
<!-- 引入redis依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- 缓存的依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-start-cache</artifactId>
</dependency>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
第二个spring-boot-start-cache的依赖,是使用缓存注解需要的,我在项目中没有引入。
因为我在websocket中已经引入了。
查询依赖关系 ctrl+shift+alt+u 快捷键(也可以在pom.xml文件上右键->Maven->Show Dependencies…)查询maven包依赖引入关系,ctrl+f搜索包