如以下链接所述,Spring Boot 3.2.1 使用 Hibenate 6.4.1.Final。
如何使用 Gradle 覆盖 Spring Boot 的
hibernate.version
属性?
我认为在房地产方面不可能做到这一点。但我建议您在依赖项管理 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
希望这会有所帮助。