Issue with elasticsearch-rest-high-level-client in maven

Hi guys,

I have an issue with high level rest client. I'm using version 6.7.1 of the client, and every time I build my project I get version version 5.2.2 of org.elasticsearch:elasticsearch instead of 6.7.1. This issue is blocking me from deploying my project in WildFly.

<dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>6.7.1</version>
 </dependency>

Here is the mvn dependency tree for the client.

[INFO] +- org.elasticsearch.client:elasticsearch-rest-high-level-client:jar:**6.7.1**:compile
[INFO] |  +- org.elasticsearch:elasticsearch:jar:**5.2.2**:compile
[INFO] |  |  +- org.apache.lucene:lucene-core:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-analyzers-common:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-backward-codecs:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-grouping:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-highlighter:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-join:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-memory:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-misc:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-queries:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-queryparser:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-sandbox:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-spatial:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-spatial-extras:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-spatial3d:jar:6.4.1:compile
[INFO] |  |  +- org.apache.lucene:lucene-suggest:jar:6.4.1:compile
[INFO] |  |  +- org.elasticsearch:securesm:jar:1.1:compile

As a consequence WildFly throws exceptions

Caused by: org.jboss.weld.exceptions.DeploymentException: org/elasticsearch/common/xcontent/DeprecationHandler
	at org.jboss.weld.executor.AbstractExecutorServices.checkForExceptions(AbstractExecutorServices.java:66)
	at org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:43)
	at org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:51)
	at org.jboss.weld.bootstrap.ConcurrentBeanDeployer.createProducersAndObservers(ConcurrentBeanDeployer.java:103)
	at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:402)
	at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)
	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:95)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
	... 3 more

Any chance you are using springboot ?

When using springboot with
elasticsearch, you need to be explicit with some transitive dependencies as SpringBoot declares a version 6.4...

Basically you can put this in your pom.xml:

<properties>
  <elasticsearch.version>7.0.0<elasticsearch.version>
</properties>

See documentation here: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-customize-dependency-versions

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.