【问题标题】:Spring Data Neo4j OGM Gradle Dependency IssuesSpring Data Neo4j OGM Gradle 依赖问题
【发布时间】:2018-07-19 14:23:44
【问题描述】:

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

}

【问题讨论】:

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


    【解决方案1】:

    您正在使用带有版本1.5.8.RELEASEspring-boot-gradle-plugin。当您在此处声明依赖项 compile group: "org.springframework.data", name: "spring-data-neo4j" 时,这将引入 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 的所有好处,因为您必须停用所有内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-18
      • 1970-01-01
      • 1970-01-01
      • 2015-05-17
      • 1970-01-01
      • 2018-03-16
      • 1970-01-01
      相关资源
      最近更新 更多