Open ymolists opened 9 years ago
Moreover, all the starter guides in http://spring.io/guides/gs/accessing-data-neo4j/ are still using pre sdn4. Those docs have not been updated to the latest sdn4 which is reallllly confusing for me.
Here is my current gradle file:
apply plugin: 'spring-boot'
ext {
//neo4jVersion = ''
neo4jVersion = '2.2.5'
//neo4jOgmVersion = ''
neo4jOgmVersion = '1.1.2'
//springVersion = ""
springVersion = "4.1.4.RELEASE"
//springNeo4jVersion =''
springNeo4jVersion =':4.0.0.RELEASE'
}
dependencies {
testCompile("junit:junit:4.12")
//is this needed ? why ???
compile("javax.el:javax.el-api:2.2.4")
compile("org.hibernate:hibernate-validator")
testCompile "org.neo4j:neo4j-kernel:${neo4jVersion}:test@jar"
testCompile "org.neo4j.app:neo4j-server:${neo4jVersion}:test@jar"
testCompile "org.neo4j:neo4j-ogm:${neo4jOgmVersion}:test@jar"
testCompile "org.neo4j.test:neo4j-harness:${neo4jVersion}:test@jar"
testCompile("org.springframework:spring-test${springVersion}")
compile("org.springframework:spring-tx${springVersion}")
compile("org.springframework:spring-context${springVersion}")
compile("org.springframework.boot:spring-boot-starter${springVersion}")
compile("org.springframework.data:spring-data-neo4j${springNeo4jVersion}")
}
Have you seen http://docs.spring.io/spring-data/neo4j/docs/4.0.0.RELEASE/reference/html/#_dependencies_for_spring_data_neo4j ? You don't need http://repo.spring.io/libs-snapshot if you're using 4.0.0.RELEASE
Like i said the docs do not cover or show how to use a junit based test with all its dependencies. There seems to be a fine grained dependencies between neo4jVersion , springNeo4jVersion and springVersion. Can you kindly show how to setup a gradle based standalone junit test with the @RunWith(SpringJUnit4ClassRunner.class) ? I want to make sure i have the minimal dependencies to run a simple Junit test.
i could fire up "movies-java-spring-data-neo4j-4" with the following gradle script:
buildscript {
ext {
springBootPluginVersion = "1.2.7.RELEASE"
springBootParentVersion = "1.3.0.M5"
springDataNeo4j = "4.0.0.RELEASE"
springDataReleaseTrain = "Gosling-Release"
}
repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-snapshot" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootPluginVersion}")
classpath("io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE")
}
}
apply plugin: "java"
apply plugin: "idea"
apply plugin: "spring-boot"
apply plugin: "io.spring.dependency-management"
jar {
baseName = "movies-java-spring-data-neo4j-4"
version = "0.0.1-SNAPSHOT"
}
repositories {
mavenCentral()
maven { url "https://m2.neo4j.org" }
maven { url "https://repo.spring.io/libs-release" }
maven { url "http://repo.spring.io/libs-snapshot" }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-starter-parent:${springBootParentVersion}"
}
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-data-rest"
compile "org.springframework.data:spring-data-neo4j:${springDataNeo4j}"
compile "com.voodoodyne.jackson.jsog:jackson-jsog:1.1"
testCompile "org.springframework.boot:spring-boot-starter-test"
}
it should be possible to adapt the script to your needs.
I have the dependencies listed in the http://docs.spring.io/spring-data/neo4j/docs/current/reference/html/ needed for the InProcessServer on my class paht (using gradle), as you were also trying to do, I assume. Unfortuantely I still cannot find the InProcessServer on my classpath. Are the maven dependencies different than gradle?
Also do i (still) need the http://repo.spring.io/libs-snapshot repository ?
I would like to not depend on a snapshot release if possible now that sdn 4.0.0 is released