Gradle configuration in Java Rest client 5.0


(Roopesh Kumar) #1

Hi,
I am new to Gradle. I want to use java rest client using gradle configuration. So I created a gradle project and defined dependency in build.gradle as follows.

dependencies {
compile 'org.elasticsearch.client:rest:5.0.1'
}

But on compilation, I am getting the following error.

  • What went wrong:
    Could not resolve all dependencies for configuration ':compile'.

Cannot resolve external dependency :org.elasticsearch.client:rest because no repositories are defined.
Required by:
:ElasticSearch:unspecified

Please help me.


(David Pilato) #2

I think it's a gradle misconfiguration probably.
But I have no idea.

May be using debug mode will tell you more?


(Jörg Prante) #3

Use

repositories {
   mavenCentral()
}

in your build.gradle. Read https://docs.gradle.org/current/userguide/userguide.pdf


(Roopesh Kumar) #4

Hi Jprante,
Thanks.
elasticsearch has also removed gradle configuration (as I used) from its documentation. So now this will work. :slight_smile:


(system) #5

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