# A different version of the library has been downloaded

**URL:** https://discuss.elastic.co/t/a-different-version-of-the-library-has-been-downloaded/271038
**Category:** Elasticsearch
**Created:** [April 23, 2021, 5:30am UTC](https://discuss.elastic.co/t/a-different-version-of-the-library-has-been-downloaded/271038 "2021-04-23T05:30:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tom-shumi](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@tom-shumi](https://discuss.elastic.co/u/tom-shumi)
#### Post date: [April 23, 2021, 5:30am UTC](https://discuss.elastic.co/t/a-different-version-of-the-library-has-been-downloaded/271038/1 "2021-04-23T05:30:55Z")

</div>

I have defined version 6.8.6 Elasticsearch in build.gradle.

`implementation group: 'org.elasticsearch', name: 'elasticsearch', version: '6.8.6'`

Then version 6.8.6 and version 7.6.2 were downloaded.  
Why?  
Moreover, due to the transitive dependency of gradle, application used version 7.6.2.

I want to use version 6.8.6.

help me..

↓ My build.gradle

```auto
ext {
        set('elasticsearch.version', '6.8.6')
    }

    dependencies {
        implementation "org.elasticsearch:elasticsearch:6.8.6"

        implementation("org.elasticsearch.client:elasticsearch-rest-high-level-client:6.8.6") {
            exclude group: "org.elasticsearch" ,module: "elasticsearch"
        }
        implementation("org.elasticsearch.client:elasticsearch-rest-client:6.8.6") {
            exclude group: "org.elasticsearch" ,module: "elasticsearch"
        }

    }
    configurations.all {
        resolutionStrategy {
            dependencySubstitution {
                substitute module('org.elasticsearch.client:elasticsearch-rest-high-level-client') with module('org.elasticsearch.client:elasticsearch-rest-high-level-client:6.8.6')
                substitute module('org.elasticsearch.client:elasticsearch-rest-client') with module('org.elasticsearch.client:elasticsearch-rest-client:6.8.6')
                substitute module('org.elasticsearch:elasticsearch') with module('org.elasticsearch:elasticsearch:6.8.6')

            }
        }
        resolutionStrategy.force "org.elasticsearch:elasticsearch:6.8.6"
    }

```

---

<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: [May 21, 2021, 5:31am UTC](https://discuss.elastic.co/t/a-different-version-of-the-library-has-been-downloaded/271038/2 "2021-05-21T05:31:12Z")

</div>

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