springboot2.x 整合redis
1.jar包依赖 <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.9.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> 2.application.yml # redis配置 redis: host: localhost password: timeout: 2000 port: 6379 3.config配置类 package com.example.proserver.config; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; /** * @Title: RedisProperties * @ProjectName proserver * @date 2019/3/511:33 */ @Data @ConfigurationProperties(prefix