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, you should add our snapshot repository to your Maven config:

<repositories>
    <repository>
        <id>es-snapshots</id>
        <name>elasticsearch snapshot repo</name>
        <url>https://snapshots.elastic.co/maven/</url>
    </repository>
</repositories>

or in Gradle:

maven {
        url "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>7.13.4</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:7.13.4'
}

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 7.0.0-beta1 version which depends on Lucene 8.0.0-snapshot-83f9835, you must define the following repository.

For Maven:

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

For Gradle:

maven {
    name 'lucene-snapshots'
    url 'https://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/83f9835'
}