Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Integrating gradle custom plugin, does not get pickup by downstream repos. #3025

Closed
prudhvigodithi opened this issue Apr 21, 2022 · 2 comments
Labels

Comments

@prudhvigodithi
Copy link
Member

Describe the bug
As part of the effort, to migrate the generated plugin zips to maven, I have created a java custom gradle plugin, so that downstream repos can apply the plugin during the distribution build. Example as apply plugin: 'opensearch.zippublish', once applied the generated zips should be published to maven repo. I see the OpenSearch already has some custom plugins to avoid reusability, the same way I have added a custom java plugin as shown in the PR, but when I try to run the manifest file I dont see this custom plugin gets added to local maven repo for the the components to use this and throws

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/tmp/tmpkn5redc4/job-scheduler/build.gradle' line: 33

* What went wrong:
A problem occurred evaluating root project 'opensearch-job-scheduler'.
> Plugin with id 'opensearch.zippublish' not found.

Just to summarize the plugin functionality works fine as expected, just the pending part is how to integrate with the existing custom plugin setup, so that even this is added to local maven repo during runtime and each component can then use it.

To Reproduce
Steps to reproduce the behavior:

  1. Add the custom gradle java plugin to this location
  2. apply plugin: 'opensearch.zippublish' to any the plugin components Ex job-scheduler
  3. Run ./build.sh manifests/2.0.0/opensearch-2.0.0.yml --snapshot --component job-scheduler

Expected behavior
The expected behavior is to identify the applied plugin and proceed to execute the plugin functionality.

Screenshots
Screen Shot 2022-04-21 at 7 31 31 AM

@dblock
Copy link
Member

dblock commented Apr 21, 2022

@prudhvigodithi I hear you've resolved this?

@prudhvigodithi
Copy link
Member Author

prudhvigodithi commented Apr 21, 2022

Hey @dblock yes, the issue is resolved,
So my plugin gets added to build-tools (that has a particular version), but in build.gradle, it points to wrong build-tools version. hence it throws the error as
Plugin with id 'opensearch.zippublish' not found.
If I point to right build-tools version
Example as

classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
to
classpath "org.opensearch.gradle:build-tools:2.0.0-alpha1-SNAPSHOT

Then things are good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants