Spring Data Neo4j OGM Gradle依赖问题

时间:2018-02-08 21:42:54

标签: gradle neo4j build.gradle spring-data-neo4j neo4j-ogm

我正在尝试使用gradle和spring依赖管理插件来管理我的spring依赖项。目前这降低了版本5.0.3.RELEASE的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"

}

1 个答案:

答案 0 :(得分:0)

您使用版本为spring-boot-gradle-plugin的{​​{1}}。当您在此处声明依赖项1.5.8.RELEASE时,这将引入SDN的版本4及其依赖项OGM 2.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的所有好处,因为你必须停用所有的东西。