多模块项目具有以下依赖关系的模块:web-> core-> persistence
我在网络模块中添加了spring-boot-gradle-plugin:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE")
}
}
apply plugin: 'spring-boot'
当spring-boot-gradle-plugin下载旧的hibernate版本时,我在持久性模块中有重复项 .
我试图覆盖Web模块中的hibernate依赖项,它正在工作:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE")
}
}
apply plugin: 'spring-boot'
dependencies {
compile project(':core')
//Other dependencies
compile "org.hibernate:hibernate-core:${hibernateVersion}"
compile "org.hibernate:hibernate-validator:${hibernateValidatorVersion}"
compile "org.hibernate:hibernate-entitymanager:${hibernateVersion}"
}
为什么插件下载旧的hibernate版本?有没有可能从spring-boot-gradle-plugin中排除旧的hibernate版本?
1 回答
首先,考虑将您的插件版本升级到1.5.9.RELEASE,这是当前的稳定版本 . 另外,考虑使用Spring数据jpa依赖项,根据文档,
你可以找到链接here . 它还向您展示了如何覆盖它以在maven项目中使用更多当前版本,而该项目并未完成 .