# How to build a plugin for a not yet released version?

**URL:** https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833
**Category:** Elasticsearch
**Created:** [June 23, 2021, 5:58pm UTC](https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833 "2021-06-23T17:58:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![rafis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafis/32/90717_2.png) [@rafis](https://discuss.elastic.co/u/rafis)
#### Post date: [June 23, 2021, 5:58pm UTC](https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833/1 "2021-06-23T17:58:17Z")

</div>

Hello,  
I need to test a fix for elasticsearch 7.14.0 code with my plugin installed. The plugin version must match to be installed, but the latest publicly available build-tools is 7.13.2. I can build elasticsearch-7.14.0-SNAPSHOT.jar from sources, but I do not know where to get org.elasticsearch.gradle:build-tools:7.14.0. If I set version to 7.14.0 in gradle, I get error:

> Could not resolve all artifacts for configuration ':classpath'.  
> Could not find org.elasticsearch.gradle:build-tools:7.14.0.  
> Searched in the following locations:  
> - [https://repo.maven.apache.org/maven2/org/elasticsearch/gradle/build-tools/7.14.0/build-tools-7.14.0.pom](https://repo.maven.apache.org/maven2/org/elasticsearch/gradle/build-tools/7.14.0/build-tools-7.14.0.pom)  
> - [https://plugins.gradle.org/m2/org/elasticsearch/gradle/build-tools/7.14.0/build-tools-7.14.0.pom](https://plugins.gradle.org/m2/org/elasticsearch/gradle/build-tools/7.14.0/build-tools-7.14.0.pom)  
> Required by:  
> project :

What is the right way to build a compatible plugin?  
Thank you!

---

<div class="post-metadata">

### Author: ![MarkVieira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markvieira/32/45333_2.png) [@MarkVieira](https://discuss.elastic.co/u/MarkVieira)
#### Post date: [June 23, 2021, 7:02pm UTC](https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833/2 "2021-06-23T19:02:57Z")

</div>

You'll need to use the snapshot version of the plugin since 7.14.0 has not yet been released. Snapshot versions are published to a separate repository, but you can add it to your build:

```auto
repositories {
  maven {
    url = 'https://snapshots.elastic.co/maven'
  }
}

```

You can then use version `7.14.0-SNAPSHOT` of the build tools.

---

<div class="post-metadata">

### Author: ![dikunov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dikunov/32/77467_2.png) [@dikunov](https://discuss.elastic.co/u/dikunov)
#### Post date: [June 23, 2021, 7:50pm UTC](https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833/3 "2021-06-23T19:50:21Z")

</div>

It seems like [https://snapshots.elastic.co/maven/org/elasticsearch/gradle/build-tools/7.14.0-SNAPSHOT/build-tools-7.14.0-SNAPSHOT.pom](https://snapshots.elastic.co/maven/org/elasticsearch/gradle/build-tools/7.14.0-SNAPSHOT/build-tools-7.14.0-SNAPSHOT.pom) is broke.  
It contains `<groupId>org.elasticsearch</groupId>` instead of `<groupId>org.elasticsearch.gradle</groupId>` and this breaks Gradle artifact validation with such error:

```auto
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.elasticsearch.gradle:build-tools:7.14.0-SNAPSHOT.
Caused by: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParseException: inconsistent module metadata found. Descriptor: org.elasticsearch:build-tools:7.14.0-SNAPSHOT Errors: bad group: expected='org.elasticsearch.gradle' found='org.elasticsearch'
	at org.gradle.api.internal.artifacts.repositories.metadata.AbstractRepositoryMetadataSource.checkModuleIdentifier(AbstractRepositoryMetadataSource.java:126)
	at org.gradle.api.internal.artifacts.repositories.metadata.AbstractRepositoryMetadataSource.checkMetadataConsistency(AbstractRepositoryMetadataSource.java:116)
...

```

---

<div class="post-metadata">

### Author: ![MarkVieira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markvieira/32/45333_2.png) [@MarkVieira](https://discuss.elastic.co/u/MarkVieira)
#### Post date: [June 23, 2021, 10:01pm UTC](https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833/4 "2021-06-23T22:01:36Z")

</div>

Ah yes, that's some fallout from some recent refactorings, thanks for reporting. I've opened a PR to address this. Once merged, it'll be in the next snapshot build.

> <https://github.com/elastic/elasticsearch/pull/74520>
>
> This pull request fixes some fallout form the \`buildSrc\` refactoring. A few thin…gs:
> 
> 1. Fix the Maven coordinates for the \`build-tools\` project so it's published under the \`org.elasticsearch.gradle\` group as intended.
> 2. Remove the \`:build-tools:reaper\` runtime dependency so it's not included in the published POM. We embed this dependency in the build tools JAR so there's no need to bring it in transitively. Also, we don't publish it, so that would fail.
> 3. Remove the compile time dependency on the Shadow plugin. We only reference it for determining what artifact to bundle in the plugin bundle. We can reference this by plugin id vs by class.
> 4. Remove the \`buildSrc.marker\` file it's no longer needed as a result of #74329

---

<div class="post-metadata">

### Author: ![MarkVieira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markvieira/32/45333_2.png) [@MarkVieira](https://discuss.elastic.co/u/MarkVieira)
#### Post date: [June 28, 2021, 4:46pm UTC](https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833/5 "2021-06-28T16:46:01Z")

</div>

@dikunov the new snapshot build should be live. Can you confirm this solved your problem?

---

<div class="post-metadata">

### Author: ![rafis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafis/32/90717_2.png) [@rafis](https://discuss.elastic.co/u/rafis)
#### Post date: [June 28, 2021, 6:18pm UTC](https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833/6 "2021-06-28T18:18:54Z")

</div>

I confirm, I was able to build my plugin after your changes and after adding the following by @dikunov to get `org.apache.lucene:lucene-core:8.9.0-snapshot-ddc238e5df8`

```auto
  maven {
    name "lucene-snapshots"
    url 'https://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/ddc238e5df8'
  }

```

---

<div class="post-metadata">

### Author: ![rafis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafis/32/90717_2.png) [@rafis](https://discuss.elastic.co/u/rafis)
#### Post date: [June 28, 2021, 6:21pm UTC](https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833/7 "2021-06-28T18:21:04Z")

</div>

Thank you, @MarkVieira !

---

<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: [July 26, 2021, 6:21pm UTC](https://discuss.elastic.co/t/how-to-build-a-plugin-for-a-not-yet-released-version/276833/8 "2021-07-26T18:21:41Z")

</div>

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