0

I am trying to import Neo-4j-spatial plugin to my project, But i am ending up with Build failure. Please help

[ERROR] Failed to execute goal on project Neo4j: Could not resolve dependencies for project com.neo:Neo4j:jar:0.0.1-SNAPSHOT: Failure to find org.neo4j:neo4j-spatial:jar:0.25.5-neo4j-3.4.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.neo</groupId>
<artifactId>Neo4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Neo4j</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.2.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <!-- <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency> -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-neo4j</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.neo4j</groupId>
      <artifactId>neo4j-spatial</artifactId>
      <version>0.25.5-neo4j-3.4.0</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

I want to add geometry shapes to database hence i need spatial plugin. But due to some version mismatch am not able to run my project..

Hema
  • 988
  • 1
  • 16
  • 38

1 Answers1

1

The newer versions (since 2014) of the artifact org.neo4j:neo4j-spatial are available in the neo4j-contrib Maven repository. This repository is available at https://raw.github.com/neo4j-contrib/m2/master/releases.

Following the instructions from here, you have to add this repository to your pom.xml:

<repositories>
    <repository>
        <id>neo4j-contrib-releases</id>
        <url>https://raw.github.com/neo4j-contrib/m2/master/releases</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>neo4j-contrib-snapshots</id>
        <url>https://raw.github.com/neo4j-contrib/m2/master/snapshots</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

However, the latest version that is today available in this release repository is

<dependency>
  <groupId>org.neo4j</groupId>
  <artifactId>neo4j-spatial</artifactId>
  <version>0.25.5-neo4j-3.3.5</version> 
</dependency>

As of today the version 0.25.5-neo4j-3.4.0 is the version of the master branch in the git repo but it looks like it has not yet been released to the Maven repository. The best option would be the use the 3.3.5 version mentioned above, but if the 3.4.0 version is absoluetly required, you could either wait for a few more days and hope it becomes available in the Maven repository or you could try to build the version yourself following these instructions.

werner
  • 13,518
  • 6
  • 30
  • 45
  • Thank you i will try it .. My neo4j database version is 3.1.2 and building pom.xml for 3.3.5. Is that because am getting this error..? – Hema May 22 '18 at 05:45
  • I am not really sure if I understand you correctly. What was the outcome after adding the repositories to your pom.xml? – werner May 22 '18 at 19:17
  • Repository worked for this version of spatial `0.25.3-neo4j-3.1.4`. But problem i am facing is installed neo4j is 3.1.4. But my maven dependency are of 3.3.5. Hence now i am not able to access database. – Hema May 23 '18 at 05:53
  • So the Maven repository problem is gone? If so, maybe you should ask a new question so someone who is more familiar with the neo4j versioning schema than I can help. – werner May 23 '18 at 19:35