opensearch-plugin-template-java icon indicating copy to clipboard operation
opensearch-plugin-template-java copied to clipboard

[BUG] OpenSearch version: 1.3.6, Failed to apply plugin class 'org.opensearch.gradle.info.GlobalBuildInfoPlugin'.

Open know-no opened this issue 3 years ago • 6 comments

What is the bug?

I am trying to develop my own OpenSearch Plugin, which generated from the template project. When building the project, something went wrong with version 1.3.6.

opensearch.version -> 1.3.6

./gradlew build

A problem occurred evaluating root project 'opensearch-tenant'.

Failed to apply plugin class 'org.opensearch.gradle.info.GlobalBuildInfoPlugin'. Could not create plugin of type 'GlobalBuildInfoPlugin'. > Could not generate a decorated class for type GlobalBuildInfoPlugin. > org/gradle/jvm/toolchain/JavaInstallation

How can one reproduce the bug?

  1. open the link: https://github.com/opensearch-project/opensearch-plugin-template-java
  2. use this template
  3. clone the new project
  4. modify build.gradle, jump to line 63, change opensearch.version to 1.3.6
  5. run ./gradlew build
  6. something goes wrong

What is the expected behavior?

Nothing bad happend with verions: 2.x and 3.x

What is your host/environment?

macOS. Monterey 12.5.1 jvm: corretto-11.0.14 ide: IntelliJ IDEA 2022.1.4 (Community Edition) Build #IC-221.6008.13, built on July 19, 2022

Do you have any screenshots?

image

Do you have any additional context?

No

know-no avatar Oct 25 '22 07:10 know-no

Looks like the template is gonna need to be versioned. Could save time and effort for users.@dblock wdyt? Valid solution?

AmiStrn avatar Oct 25 '22 08:10 AmiStrn

@AmiStrn Definitely. But maybe main could track 3.0 right now, 2.x would track 2.x, etc.?

dblock avatar Oct 25 '22 18:10 dblock

@dblock yes, i agree. Going to take the lazy approach here, i will make a label for 1.1, a label for when build works with 1.3.6, and then 2.x (and main tracks 3.x).

Adding labels later for each version will make it less copy pasty too.

AmiStrn avatar Oct 26 '22 06:10 AmiStrn

@know-no in the meantime, if can you build the plugin from an earlier commit in this repo from before the breaking change was made, then you wouldnt have to wait for my change.

There are not that many commits, so it shouldnt be difficult. If this doesn't work then you would need to wait for the versioning fix.

AmiStrn avatar Oct 26 '22 06:10 AmiStrn

@AmiStrn Ok, thank you ~. I will try. If it doesn't work, i will wait.

know-no avatar Oct 27 '22 03:10 know-no

@know-no in the meantime, if can you build the plugin from an earlier commit in this repo from before the breaking change was made, then you wouldnt have to wait for my change.

There are not that many commits, so it shouldnt be difficult. If this doesn't work then you would need to wait for the versioning fix.

It works at 2d5ee08f083cda3337098fcce7e58dc461ce8bce. But ./settings.gradle and ./build.gradle still need some change: image image

know-no avatar Oct 27 '22 05:10 know-no

We have backport branches such as 2.x for this. Closing.

dblock avatar Jun 11 '24 14:06 dblock