Spring Data Neo4j OGM Gradle Dependency Issues



我正在尝试使用 gradle 和 spring 依赖项管理插件来管理我的 spring 依赖项。目前,这降低了spring-data-neo4j的5.0.3.RELEASE版本,根据这里的pom,它应该降低neo4j-ogm的3.0.3版本,但相反,它带来了2.1.5版本。这意味着,即使我已经按照文档了解了有关配置的信件,也没有找到配置构建器符号。任何帮助将不胜感激。我目前正在使用 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"
}

您正在使用版本1.5.8.RELEASEspring-boot-gradle-plugin。当您在此处声明依赖项时,这将拉入 SDN 版本 4 及其依赖项 OGM 2.1.xcompile group: "org.springframework.data", name: "spring-data-neo4j"

此时唯一的解决方案是使用 Spring Boot 2 RC1。如果你将SDN及其对Spring Data commons和Spring Framework 5的依赖关系包含在内,你会弄乱你的类路径,因为Spring Boot 1是基于Spring Framework 4的。

背景:尝试过一次在Spring Boot 1中集成SDN 5.x,但没有成功,您将失去Spring Boot的所有好处,因为您必须停用几乎所有内容。

最新更新