# Gradle configuration in Java Rest client 5.0

**URL:** <https://discuss.elastic.co/t/gradle-configuration-in-java-rest-client-5-0/68408>\
**Category:** Elasticsearch\
**Created:** [December 8, 2016, 8:49am UTC](https://discuss.elastic.co/t/gradle-configuration-in-java-rest-client-5-0/68408 "2016-12-08T08:49:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumarroopesh](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@kumarroopesh](https://discuss.elastic.co/u/kumarroopesh)\
**Post date:** [December 8, 2016, 8:49am UTC](https://discuss.elastic.co/t/gradle-configuration-in-java-rest-client-5-0/68408/1 "2016-12-08T08:49:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 9, 2016, 8:35am UTC](https://discuss.elastic.co/t/gradle-configuration-in-java-rest-client-5-0/68408/2 "2016-12-09T08:35:42Z")

</div>

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

May be using debug mode will tell you more?

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 9, 2016, 1:57pm UTC](https://discuss.elastic.co/t/gradle-configuration-in-java-rest-client-5-0/68408/3 "2016-12-09T13:57:26Z")

</div>

Use

```auto
repositories {
   mavenCentral()
}

```

in your `build.gradle`. Read [https://docs.gradle.org/current/userguide/userguide.pdf](https://docs.gradle.org/current/userguide/userguide.pdf)

---

<div class="post-metadata">

**Author:** ![kumarroopesh](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@kumarroopesh](https://discuss.elastic.co/u/kumarroopesh)\
**Post date:** [December 9, 2016, 2:50pm UTC](https://discuss.elastic.co/t/gradle-configuration-in-java-rest-client-5-0/68408/4 "2016-12-09T14:50:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 6, 2017, 2:51pm UTC](https://discuss.elastic.co/t/gradle-configuration-in-java-rest-client-5-0/68408/5 "2017-01-06T14:51:20Z")

</div>

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