Resolve Neo4j and Spring Jar Using Gradle




Asked on December 11, 2014
Hi,

I am creating an application with  Spring and neo4j. My Gradle is not able to resolve Neo4j JAR dependency. My gradle is 

apply plugin: 'java'
apply plugin: 'eclipse'
archivesBaseName = 'myApp'
version = '1.0-SNAPSHOT' 
repositories {
    mavenCentral()
}

dependencies {
    compile  'org.springframework.boot:spring-boot-starter:1.1.9.RELEASE'
compile  'org.springframework:spring-context:4.1.2.RELEASE'
compile  'org.springframework:spring-tx:4.1.2.RELEASE'
compile  'org.springframework.data:spring-data-neo4j:3.2.1.RELEASE'
compile  'org.springframework.data:spring-data-neo4j-rest:3.2.1.RELEASE'
compile  'org.hibernate:hibernate-validator:5.2.0.Alpha1'
compile  'org.neo4j:neo4j-rest-graphdb:2.0.1'
}

When I am running gradle clean build, getting below error

Could not resolve all dependencies for configuration ':compile'.
> Could not find org.neo4j:neo4j-rest-graphdb:2.0.1.
  Searched in the following locations:
      http://repo1.maven.org/maven2/org/neo4j/neo4j-rest-graphdb/2.0.1/neo4j-res
t-graphdb-2.0.1.pom
      http://repo1.maven.org/maven2/org/neo4j/neo4j-rest-graphdb/2.0.1/neo4j-res
t-graphdb-2.0.1.jar
  Required by:
      :Spring4Neo4j:1.0-SNAPSHOT
      :Spring4Neo4j:1.0-SNAPSHOT > org.springframework.data:spring-data-neo4j-re
st:3.2.1.RELEASE
> Could not find org.neo4j:neo4j-cypher-dsl:2.0.1.
  Searched in the following locations:
      http://repo1.maven.org/maven2/org/neo4j/neo4j-cypher-dsl/2.0.1/neo4j-cyphe
r-dsl-2.0.1.pom
      http://repo1.maven.org/maven2/org/neo4j/neo4j-cypher-dsl/2.0.1/neo4j-cyphe
r-dsl-2.0.1.jar
  Required by:
      :Spring4Neo4j:1.0-SNAPSHOT > org.springframework.data:spring-data-neo4j:3.
2.1.RELEASE

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.


Need help to resolve it.



Replied on December 11, 2014
Use 
Only   mavenCentral() will not suffice to resolve all Jar, Use repositories as below.

repositories {
    maven { url "https://repo.spring.io/libs-release" }
    mavenLocal()
    mavenCentral()
}



Replied on December 11, 2014
It worked. Thanks


Replied on December 23, 2014

Write Answer











©2024 concretepage.com | Privacy Policy | Contact Us