本文主要介绍java Spring Boot中的redis pom文件详细配置方法,本文通过多个案例与实例代码给大家介绍的非常详细,具有一定的参考价值,需要的朋友可以参考下
1.创建一个redis maven项目,在pom中添加如下信息
spring boot 版本
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.4.RELEASE</version> </parent>
项目相关jar配置
<dependencies> <!-- 热开发注解 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> <!--redis jar--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies>
补充知识:Java中使用redis所需要的pom依赖
我就废话不多说了,大家还是直接看代码吧~
<dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.1.0</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.3.2</version> </dependency>
以上就是java Spring Boot中的redis pom文件详细配置方法,希望对大家的学习有所帮助,也希望大家多多支持我们。