使用JDK21 SpringBoot3.4.3
spring:
data:
redis:
host: 127.0.0.1
port: 6379
database: 0
# 读超时
timeout: 3000
# 连接超时
connectTimeout: 5000
# Lettuce连接池
lettuce:
pool:
# 最小空闲连接
min-idle: 5
# 最大空闲连接
max-idle: 10
# 最大连接数
max-active: 100
# 连接分配应该阻塞的最大时间
max-wait: 2000
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>${spring-boot.version}</version>
</dependency>
我是使用阿里云镜像,不保熟
项目运行报错:Caused by: java.lang.NoClassDefFoundError: org/springframework/data/redis/serializer/RedisSerializer
Sounds like you have a corrupted download of the spring-data-redis jar. Try clearing out your Maven cache and building again.
听起来你有一个损坏的下载的spring-data-redis罐。尝试清除您的Maven缓存并重新构建。