spring-data-elasticsearch 与 spring 引导的兼容性

spring-data-elasticsearch compatibility with spring boot

我能够使用 spring-data-elasticsearch 3.0.0.RC2[=29= 连接到 Elastic Serarch 5.5.0 ].

我想将我的应用程序转换为 spring 启动应用程序。我试过 Spring Boot version 2.0.0.M2 ,但出现以下错误

Caused by: java.lang.NoSuchMethodError: org.springframework.data.elasticsearch.c
ore.mapping.ElasticsearchPersistentProperty.findAnnotation(Ljava/lang/Class;)Lja
va/lang/annotation/Annotation;
        at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsear
chPersistentEntity.addPersistentProperty(SimpleElasticsearchPersistentEntity.jav
a:157) ~[spring-data-elasticsearch-3.0.0.RC2.jar!/:?]
        at org.springframework.data.elasticsearch.core.mapping.SimpleElasticsear
chPersistentEntity.addPersistentProperty(SimpleElasticsearchPersistentEntity.jav
a:47) ~[spring-data-elasticsearch-3.0.0.RC2.jar!/:?]
        at org.springframework.data.mapping.context.AbstractMappingContext$Persi
stentPropertyCreator.createAndRegisterProperty(AbstractMappingContext.java:559)
~[spring-data-commons-2.0.0.M4.jar!/:?]
        at org.springframework.data.mapping.context.AbstractMappingContext$Persi
stentPropertyCreator.doWith(AbstractMappingContext.java:528) ~[spring-data-commo
ns-2.0.0.M4.jar!/:?]
        at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils
.java:727) ~[spring-core-5.0.0.RC2.jar!/:5.0.0.RC2]

根据下面的 link 版本矩阵,spring 启动不适用于 Elastic Search 5 版本。

https://github.com/spring-projects/spring-data-elasticsearch/wiki/Spring-Data-Elasticsearch---Spring-Boot---version-matrix

但我觉得这个矩阵已经过时了,因为 spring-data-elasticsearch 已经开始支持 ElasticSearch-5.5.0

让我知道您是否可以 运行 spring-data-elasticsearch 使用 Spring Boot 连接到 Elastic Search 5。

当我将 spring-boot-starter-parent 升级到 2.0.0.M3

时它工作正常