Elasticsearch.esplugin: project not building for ES Gradle build tools versions prior to 6.6.0

I'm aiming to write an ES Ingest Processor plugin, making use of the ES Ingest Node feature released in 5.0.0v.

I've created a few POCs built with Gradle (5.1), either through this great cookiecutter template: https://github.com/spinscale/cookiecutter-elasticsearch-ingest-processor
following this post: https://www.elastic.co/blog/writing-your-own-ingest-processor-for-elasticsearch
or creating it from scratch following some examples like this:
Elasticsearch.esplugin: Replace/Change/Disable integTestCluster#wait Task

In any case the Gradle projects won't build unless I use the es build tools 6.6.0, throwing an
Exception. With 6.5.0, I get the error below:

org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'my-ingest'.

java.lang.IllegalStateException: No value has been specified for this provider.

This is my build.gradle file:

 buildscript {
  repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
  }

  dependencies {
    classpath "org.elasticsearch.gradle:build-tools:6.5.0"
  }
}

group = 'org.elasticsearch.plugin.ingest'
version = '0.0.1-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'elasticsearch.esplugin'

licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')

esplugin {
  name 'my-ingest'
  description 'Ingest processor that is doing something'
  classname 'org.elasticsearch.plugin.my.ingest.IngestPlugin'
  licenseFile rootProject.file('LICENSE.txt')
  noticeFile rootProject.file('NOTICE.txt')
}

dependencies {
  compile 'org.elasticsearch:elasticsearch:6.5.0'

  testCompile 'org.elasticsearch.test:framework:6.5.0'
}

Stack: openjdk 11, gradle 5.1, intellij 2018.3.4 (or directly on Terminal),

with classpath "org.elasticsearch.gradle:build-tools:6.5.0" or lower -> won't work
with classpath "org.elasticsearch.gradle:build-tools:6.6.0" -> works

I'm trying to understand why this is happening, since I believe esplugin should work in any version from 5.0.0. I might be missing something. I can develop in 6.6.0, there's no problem, I just would like to get this situation.

Any thoughts are appreciated. Thanks in advance.

1 Like

Our build tools do a bunch of relatively complex things and are susceptible to changes in gradle's beahviour across different versions.

The 6.5.0 build tools were written for Gradle 4.10, and do not work with Gradle 5 due to changes between gradle 4.10 and 5.0; The 6.6.0 build tools were updated to accommodate the change in gradle behaviour.

If you want to use a version of build-tools prior to 6.6.0 then you will need to use Gradle 4.10 (or potentially an older version of Gradle depending on which version of the build tools you want to use).

1 Like

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