我正在尝试使用gradle和spring依赖管理插件来管理spring依赖。目前,这会降低版本5.0.3。的spring-data-neo4j的发行版,根据pom here,应该降低neo4j-ogm的版本3.0.3,但相反会降低版本2.1.5。这意味着即使我按照文档的顺序去找到有关configuration的字母,也没有找到ConfigurationBuilder符号。任何帮助将不胜感激。我目前正在使用Gradle 4.4.1
buildscript {
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/plugins-snapshot' }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.8.RELEASE")
classpath 'io.spring.gradle:dependency-management-plugin:1.0.5.BUILD-SNAPSHOT'
}
}
plugins {
id "io.spring.dependency-management" version "1.0.4.RELEASE"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: "io.spring.dependency-management"
ext {
springVersion = '5.0.3.RELEASE'
springDataVersion = 'Kay-SR3'
}
dependencyManagement {
imports {
mavenBom "org.springframework:spring-framework-bom:${springVersion}"
mavenBom "org.springframework.data:spring-data-releasetrain:${springDataVersion}"
}
}
repositories {
mavenCentral()
maven {
url 'https://repo.spring.io/libs-release'
}
}
dependencies {
compile group: "org.springframework.boot", name: "spring-boot-starter-web"
compile group: "org.springframework.boot", name: "spring-boot-starter-security"
compile group: "org.springframework", name: "spring-aspects"
compile group: "org.springframework.data", name: "spring-data-neo4j"
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310'
testCompile group: "org.springframework.boot", name: "spring-boot-starter-test"
testCompile group: "org.neo4j", name: "neo4j-ogm-embedded-driver", version: "3.1.0"
}
最佳答案
您正在使用spring-boot-gradle-plugin
和1.5.8.RELEASE
版本。当您在compile group: "org.springframework.data", name: "spring-data-neo4j"
中声明依赖性时,这将引入SDN的版本4及其依赖性OGM2.1.x。
此时唯一的解决方案是使用Spring Boot 2 RC1。如果您要包括SDN及其对Spring Data Commons和Spring Framework 5的依赖关系,您会弄乱您的类路径,因为Spring Boot 1是基于Spring Framework 4的。
背景:曾经尝试过将SDN 5.x集成到Spring Boot 1中,但是没有成功,由于您必须停用所有内容,因此您将失去Spring Boot的所有优势。
关于gradle - Spring Data Neo4j OGM Gradle依赖关系问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48695258/