当前位置: 首页 > 知识库问答 >
问题:

Spring Data Neo4j OGM梯度依赖问题

莘光华
2023-03-14
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个答案

韩捷
2023-03-14

您使用的是spring-boot-gradle-plugin版本1.5.8.release。当您在编译组:“org.springframework.data”,名称:“spring-data-neo4j”声明依赖项时,这将引入SDN版本4及其依赖项OGM 2.1.x。

在这一点上,唯一的解决方案是使用Spring Boot2RC1。如果将SDN及其对Spring数据共享区和Spring Framework 5的依赖项包括在内,您将会搞乱类路径,因为Spring Boot1是基于Spring Framework 4的。

背景:尝试过一次在Spring Boot1中集成SDN5.x,但没有成功,您将失去Spring Boot的所有好处,因为您必须停用相当多的东西。

 类似资料:
  • 我正在尝试从https://android-arsenal.com/details/1/1375添加一个样式化的进度条 上面写着: 将特定存储库添加到构建文件: 在构建文件中添加依赖项(不要忘记指定正确的限定符,通常是'aar'): 我做了...Build.Gradle(项目) Build.Gradle(模块):应用插件:“com.android.application” android{comp

  • 我已经集成了CircleCI来在我的应用程序上运行Espresso测试。我从另一个在线github存储库中获取了以下circle.yml文件,并将android构建工具和android版本更改为25。但是,当我在CircleCI服务器上运行构建时,我收到以下错误。我已经在yml文件中授予了执行权限。 我的应用回购结构是 circle.yml(圈.yml): gradle/wrapper/gradl

  • 我是Gradle的新手,我正在尝试这个教程https://spring.io/guides/gs/rest-service/我能够编译具有所需依赖项的jar并运行它。然而,IDE无法识别这些库,这让我很恼火。 有没有办法呢?

  • 我正在和我的朋友一起做一个智能J项目,我们使用MongoDB 我没有设置这些东西,我从一个存储库中克隆了它。但是我的其他朋友已经让它工作了——都在视窗、OSX和Linux上。只有一个人设置了它。 问题是它不知道什么是莫菲/MongoDB(例如,导入不起作用)。 我做了什么: 重新同步渐变 运行Gradle。生成文件 重新审视项目 使缓存无效并重新启动 它仍然不知道MongoDB是什么。所以我尝试让

  • 我已经四处寻找了一段时间,似乎找不到任何关于这个问题的东西。总的来说,我是Java的新手,在过去的半年里,我一直在学习Maven。我使用IntelliJ IDEA,我已经习惯了这样一个事实,即如果你同步存储库,它可以自动完成依赖坐标(group Id、artifactId、version)。它工作得很好,当你决定在最初的项目生成后添加一些依赖关系时,感觉很自然。 现在我正试图切换到Gradle(这