开发者社区 问答 正文

为了使用Spring Cache,我需要在项目中添加哪些Maven依赖?

为了使用Spring Cache,我需要在项目中添加哪些Maven依赖?

展开
收起
冲冲冲c 2024-06-21 20:46:21 122 分享 版权
1 条回答
写回答
取消 提交回答
  • 为了使用Spring Cache,你需要在项目中添加spring-boot-starter-cache和caffeine两个Maven依赖。具体的依赖配置如下:

    <dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-cache</artifactId> 
    </dependency> 
    <dependency> 
    <groupId>com.github.ben-manes.caffeine</groupId> 
    <artifactId>caffeine</artifactId> 
    </dependency>
    
    2024-06-21 21:28:29
    赞同 3 展开评论