如何使用 Spring Boot 覆盖 hibernate.version?

问题描述 投票:0回答:1

如以下链接所述,Spring Boot 3.2.1 使用 Hibenate 6.4.1.Final。

https://docs.spring.io/spring-boot/docs/3.2.1/reference/html/dependency-versions.html#appendix.dependency-versions

如何使用 Gradle 覆盖 Spring Boot 的

hibernate.version
属性?

spring-boot gradle dependency-management
1个回答
0
投票

我认为在房地产方面不可能做到这一点。但我建议您在依赖项管理 build.gradle 文件中处理它。您只需要排除并手动添加您想要的版本的休眠依赖项即可。

gradle kotlin 示例:

//...
dependencies {
  //...
  implementation("org.springframework.boot:spring-boot-starter-data-jpa"){
    exclude(group = "org.hibernate.orm", module = "hibernate-core")
  }

  // For hibernate 6+ use group org.hibernate.orm
  implementation("org.hibernate", "hibernate-core") {
    version {
        strictly("5.6.15.Final")
    }
  }
  //...
}
/...

https://docs.gradle.org/current/userguide/dependency_downgrade_and_exclude.html

希望这会有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.