gradle 在编译期间未找到org.elasticsearch.search.aggregations.AbstractAggregationBuilder

pbossiut  于 2023-04-12  发布在  ElasticSearch
关注(0)|答案(1)|浏览(128)

我在19.0.2上使用spring-data-elasticsearch和最近的依赖项编译Sping Boot 应用程序时遇到了这个错误。
在编译期间未找到org.elasticsearch.search.aggregations.AbstractAggregationBuilder

./gradlew --version

------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          19.0.2 (Private Build 19.0.2+7-Ubuntu-0ubuntu322.04)
OS:           Linux 5.19.0-38-generic amd64

java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)
OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)

> Task :compileJava FAILED
An exception has occurred in the compiler (19.0.2). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.elasticsearch.search.aggregations.AbstractAggregationBuilder not found
olmpazwi

olmpazwi1#

org.elasticsearch.search.aggregations.AbstractAggregationBuilder来自7.17版本的旧Elasticsearch客户端库,并与NativeQueryBuilder和Elasticsearch RestHighLevelClient一起使用。
对于Spring Data Elasticsearch版本5.0中使用的新Elasticsearch客户端,您将需要使用elasticsearch-java客户端库中的客户端类,如co.elastic.clients.elasticsearch._types.aggregations.Aggregation

相关问题