Maven Repositoryedit

The high-level Java REST client is hosted on Maven Central. The minimum Java version required is 1.8.

The High Level REST Client is subject to the same release cycle as Elasticsearch. Replace the version with the desired client version.

If you are looking for a SNAPSHOT version, the Elastic Maven Snapshot repository is available at https://snapshots.elastic.co/maven/.

Maven configurationedit

Here is how you can configure the dependency using maven as a dependency manager. Add the following to your pom.xml file:

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

Gradle configurationedit

Here is how you can configure the dependency using gradle as a dependency manager. Add the following to your build.gradle file:

dependencies {
    compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:6.4.0'
}

Lucene Snapshot repositoryedit

The very first releases of any major version (like a beta), might have been built on top of a Lucene Snapshot version. In such a case you will be unable to resolve the Lucene dependencies of the client.

For example, if you want to use the 6.0.0-beta1 version which depends on Lucene 7.0.0-snapshot-00142c9, you must define the following repository.

For Maven:

<repository>
    <id>elastic-lucene-snapshots</id>
    <name>Elastic Lucene Snapshots</name>
    <url>http://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/00142c9</url>
    <releases><enabled>true</enabled></releases>
    <snapshots><enabled>false</enabled></snapshots>
</repository>

For Gradle:

maven {
    url 'http://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/00142c9'
}