Elastic Search 5.4 with Spring Boot 1.5。*

问题描述:

我想用Elastic Search 5.4构建一个Spring Boot App(1.5。)。和我在pom.xml文件中有一些冲突。 通过快速搜索,我看到Spring Boot不支持Elastic 5. *版本,我需要降级到2. *Elastic Search 5.4 with Spring Boot 1.5。*

是否有任何其他方法可以解决此问题? 通过排除某些检查依赖关系。

预先感谢您!

我的pom.xml

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.5.4.RELEASE</version> 
</parent> 

<dependencies> 

    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.logging.log4j</groupId> 
     <artifactId>log4j-slf4j-impl</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.logging.log4j</groupId> 
     <artifactId>log4j-api</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.logging.log4j</groupId> 
     <artifactId>log4j-core</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.logging.log4j</groupId> 
     <artifactId>log4j-jcl</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter</artifactId> 
     <exclusions> 
      <exclusion> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-starter-logging</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-log4j2</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</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-security</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.mockito</groupId> 
     <artifactId>mockito-core</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.elasticsearch.client</groupId> 
     <artifactId>transport</artifactId> 
     <version>5.4.1</version> 
    </dependency> 
    <dependency> 
     <groupId>com.google.code.gson</groupId> 
     <artifactId>gson</artifactId> 
     <version>2.8.1</version> 
    </dependency> 

    <!--For GEO things--> 
    <dependency> 
     <groupId>org.locationtech.spatial4j</groupId> 
     <artifactId>spatial4j</artifactId> 
     <version>0.6</version> 
    </dependency> 

    <dependency> 
     <groupId>com.vividsolutions</groupId> 
     <artifactId>jts</artifactId> 
     <version>1.13</version> 
     <exclusions> 
      <exclusion> 
       <groupId>xerces</groupId> 
       <artifactId>xercesImpl</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
</dependencies> 

默认springboot内elasticsearch为2。**,但是你可以将其设置为相同的版本为你elasticsearch

<properties> 
    <elasticsearch.version>5.4.1</elasticsearch.version> 
</properties> 
+0

这是真的快..! 非常感谢! – pik4