Compiling Ingest Plugin Fails

I'm having a weird issue while trying to compile and package an ingest plugin for ES 7.4.0.

I started from @spinscale's cookiecutter project template and was able to properly create the project and implement the business logic.

However, when trying to compile the project using gradle clean check I get the following error:

> Task :generateGlobalBuildInfo FAILED

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':generateGlobalBuildInfo'.

> The compiler java.home must be set to a JDK installation directory for Java 12 but is [/Library/Java/JavaVirtualMachines/jdk-11.0.4.jdk/Contents/Home] corresponding to [11]

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 597ms

1 actionable task: 1 executed 

I have Java 11 installed (as can be seen in the error message). Since Java 12 is EOL, it is impossible for me to install it. I have tried with Java 13, but I get a different error message:

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

-----------

* Where:

Build file '/Users/consulthys/workspaces/elasticsearch-ingest-h3/build.gradle' line: 18

* What went wrong:

A problem occurred evaluating root project 'ingest-h3'.

> Failed to apply plugin [class 'de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin']

> Could not create plugin of type 'ForbiddenApisPlugin'.

> Could not initialize class de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

==============================================================================

2: Task failed with an exception.

-----------

* What went wrong:

A problem occurred configuring root project 'ingest-h3'.

> Must specify license and notice file for project :

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 615ms

So it seems to require me to have Java 12, even though the support matrix explicitly states that Java 12 is not supported with 7.4.0, only Java 11 ad 13.

I'd appreciate if anyone could shed some light on this and how to resolve this issue, it's a bit frustrating.

the java version should only be required for building, but you can still run elasticsearch and the plugin with java 8.

Forbidden APIs has just been released to properly support java 13, and was updated in the ES project only a few days ago. To me it seems that building the plugin with java 12 should be fine and run it with the java version you run Elasticsearch as.

hope that makes sense.

Thank you for answering @spinscale .

The problem is that I have never installed Java 12 and since it's EOL it's not possible to install it any more. So as it stands, I cannot build the plugin with either Java 8, 11 or 13.

I have a same problem. Have you solved it yet?

Small workaround around the installation issue: Using sdkman installing java 12 is just a single command away. sdk install java 12.0.2-open. You can use sdk list java to list possible installation candidates.

You can get sdkman at https://sdkman.io

Thanks Alexander. That actually did the trick, I could install Java 12, build the plugin and install it on Elastic Cloud :+1:

I still think this is not the best way and that the plugin building process deserves to be better organized.

Thanks a lot for your help, though, much appreciated!

1 Like

Please don't hesitate to open a github issue with the issues you had to get up and running, I think it is worthwhile to share. If you have any suggestions do better organize that process, please add them as well.

Much appreciated! Have a good weekend!

Sure will do!

In the meantime, if anyone is interested in that ingest plugin (for generating Uber H3 hexagonal geo indexes), it has been announced here:

2 Likes

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