Spring 数据 Neo4j OGM Gradle 依赖问题

Spring Data Neo4j OGM Gradle Dependency Issues

我正在尝试使用 gradle 和 spring 依赖管理插件来管理我的 spring 依赖。目前,这会降低 spring-data-neo4j 的 5.0.3.RELEASE 版本,根据 pom here, should bring down version 3.0.3 of the neo4j-ogm, but instead it brings down version 2.1.5. This means that even though I've followed the docs to the letter about 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"

}

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

此时唯一的解决办法是使用Spring Boot 2 RC1。如果您将 SDN 及其对 Spring Data commons 和 Spring Framework 5 的依赖项包含在内,您将弄乱 class 路径,因为 Spring Boot 1 基于 Spring 框架 4.

背景:曾尝试将 SDN 5.x 集成到 Spring Boot 1 但没有成功,您将失去 Spring Boot 的所有好处,因为您必须停用漂亮的一切。