新建一个Springboot工程,如果工程没有建好,请看SpringBoot Gradle 项目创建。
一、build.gradle添加依赖
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: '2.0.0.RELEASE'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-redis
compile group: 'org.springframework.boot', name: 'spring-boot-starter-redis', version: '1.4.7.RELEASE'
// https://mvnrepository.com/artifact/redis.clients/jedis
compile group: 'redis.clients', name: 'jedis', version: '2.9.0'二