首页 > 解决方案 > 将 spring-data-commons 与 spring-boot-2.1.x 一起使用时的包问题

问题描述

我正在将 Spring Boot 从 1.5.12 迁移到 2.1.14。我们使用 Gradle 作为构建工具,因此作为 Spring Boot 迁移的一部分,我们必须将 Gradle 从 3.x 更改为 4.x,并尝试根据需要更新 build.gradle。迁移后,CRUDRepository 相关 API 中会显示错误。

我们正在使用 spring-boot-starter-data-jpa 和 spring-data-commons

迁移前:

  1. spring-boot-starter-data-jpa - 1.5.12(从 Spring Boot 版本获取)
  2. spring-data-commons (1.13.12.RELEASE)

显示 org.springframework.data.repository 包没有错误

迁移后:

  1. spring-boot-starter-data-jpa - 2.1.14(从 Spring Boot 版本获取)
  2. spring-data-commons (2.0.7.RELEASE)

错误:org.springframework.data.repository。未解决

如果我将 spring-data-common-1.13.12.RELEASE 与 spring-boot-2.x 一起使用,则会出现以下错误。

原因:找不到 org.springframework.data.repository.config.BootstrapMode 的类文件

有人可以提出一些建议来解决这个问题。

提前致谢

标签: spring-bootgradlespring-data-commonsgraphql-spqr-spring-boot-starter

解决方案


推荐阅读