简体   繁体   中英

Maven spring-data-elasticsearch dependency Not Found

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 !

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>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM