springboot集成redis时,在pom文件中引入spring-boot-starter-redis包报错,提示找不到相应的jar包,如下图:
在本地maven仓库中找了一遍,确实没有这个jar包,以为是没有从中央仓库下载下来,所以重新运行maven命令下载jar包并更新项目,依然报错。
网上搜下了问题,才知道,原来我项目用的spring boot是2.0以后的版本,spring-boot-starter-redis在springboot 1.4.7版本后,
改为了spring-boot-starter-data-redis,所以如果想集成redis,应该引用spring-boot-starter-data-redis。
如果就是想用前者,那么就应该加上版本号。