0
votes

I have a spring boot app for which I want to use the dependency spring-data-elasticsearch. I'm using one of the latest version of Elasticsearch on my server (v5.4.x) so I had to use the latest snapshot of spring-data-elasticsearch (3.0.0.BUILD-SNAPSHOT).

According to the git page (link below) :

https://github.com/spring-projects/spring-data-elasticsearch/blob/master/README.md

I have to declare in my pom.xml a special repository where is located this specific version of the dependency, as you can see below :

<repositories>
        <repository>
      <id>spring-libs-snapshot</id>
      <name>Spring Snapshot Repository</name>
      <url>http://repo.spring.io/libs-snapshot</url>
    </repository>
</repositories>

<dependencies>

    <!--  ELK -->
    <dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-elasticsearch</artifactId>
      <version>3.0.0.BUILD-SNAPSHOT</version>
    </dependency>

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


    <!-- MySQL -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
    </dependency>

</dependencies>

But I have the following error on my pom.xml :

Missing artifact org.springframework.data:spring-data-elasticsearch:jar:3.0.0.BUILD-SNAPSHOT

Anyone knows where the problem is coming from please ? I'm pulling hairs out of my head since 2 hours.

Thank you !

2
I put these in a new pom.xml in a new project and it builds fine. Did you try to force maven to update i.e. mvn clean compile -U ? - Manos Nikolaidis
@ManosNikolaidis , i tried your command but i have the following error : The POM for org.springframework.data:spring-data-elasticsearch:jar:3.0.0.BUILD-SNAPSHOT is missing, no dependency information available - le_cug

2 Answers

0
votes

You probably have to add the Spring snapshot repository to your pom.xml

<repositories>
    <repository> 
        <id>repository.spring.snapshot</id> 
        <name>Spring Snapshot Repository</name> 
        <url>http://repo.spring.io/snapshot</url> 
    </repository>
</repositories>
0
votes

Thanks for your replies but I'm feeling like a fool. In my company we work with a nexus where all the repos are deployed, so I had to add the informations about the repos in my nexus too.

Sorry for the inconvenience.