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

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://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!

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:

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

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

1 Like

It seems like 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:

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)
...

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.

1 Like

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

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

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

Thank you, @MarkVieira !

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