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

Fix publishing to Gradle Plugin Portal #3031

Merged
merged 2 commits into from Jun 7, 2023
Merged

Conversation

IgnatBeresnev
Copy link
Member

This seems to be a regression from #2912. It was blocking the release, but I commited this fix directly into the release branch, so no rush now.

Without this change, running ./gradlew publishPlugins results in:

> Task :publishPlugins FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':publishPlugins'.
> No plugins defined. Please declare at least one plugin in a pluginBundle plugins block

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.

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

With this change, the artifacts are built and published as expected (well, time will tell).

As far as I understand, we need to define the plugin use in the root project so that it can be used later on in the Gradle runner:

id("com.gradle.plugin-publish")

If the plugin application is removed from the root project, then the line above in the Gradle runner will fail to resolve the plugin ("plugin was not found in any of the following sources").

So I'm not sure that what I'm suggesting is the best fix, looks like it could be improved, but it works for now. Perhaps, it should be revisited in #2919 or #3030.

If a better alternative is suggested, I can try to implement it as part of this PR, but as long as it doesn't take a lot of time or a lot of re-writing - then it's best addressed separately.

@IgnatBeresnev
Copy link
Member Author

It seems like there's no better way as of now :(

@IgnatBeresnev IgnatBeresnev merged commit 2611263 into master Jun 7, 2023
11 checks passed
@IgnatBeresnev IgnatBeresnev deleted the fix-gradle-publication branch June 7, 2023 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant