gradle - Spring Data Neo4j OGM Gradle依赖关系问题

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

我正在尝试使用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-plugin1.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/

相关文章:

react-native - Firebase - Gradle 构建失败 - com.google.android.gms :play-services-measurement-base

android - 在 gradle android 闭包中定义时,是否必须在 AndroidManifest.xml 中设置 SDKVersion?

java - Gradle构建失败

java - Neo4j Rest graphdb 连接到远程 heroku 实例时挂起

更新后 Gradle 构建失败

java - 如何修复 "More than one file was found with OS independent path ' project.properties'"Android Studio 3.0 Beta-6 中的错误

gradle - Kotlin 原生 protobuf 问题

linux - Neo4j:通过Dockerfile中的Shell脚本将文件夹复制到/data目录

javascript - 使用node js在neo4j中创建 Node 时出现错误

android - 每次收到推送通知时,Ionic 2 应用程序都会停止