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

Publish to MavenCentral? #61

Closed
martinbonnin opened this issue May 3, 2023 · 10 comments
Closed

Publish to MavenCentral? #61

martinbonnin opened this issue May 3, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@martinbonnin
Copy link
Contributor

Would you consider publishing the plugin to Maven Central? Gradle Plugin Portal works too but having it in Maven Central would make it more discoverable when used in convention plugins, etc... ?

@aSemy
Copy link
Contributor

aSemy commented May 3, 2023

Thanks for the request, I totally agree! Publishing to Maven Central would be a solid improvement.

However, I've had a lot of trouble trying to make Gradle + Signing + Maven Central work in other projects, so I've been avoiding it. The ease of the Gradle Plugin Portal is a breath of fresh air in comparison!

Do you know how to best set up Maven Central publishing? Do you want to make a PR?

I know there are helper plugins like https://github.com/gradle-nexus/publish-plugin, but I don't like that they use discouraged techniques like afterEvaluate {} and allprojects {}, so I want to avoid them.

@aSemy aSemy added the enhancement New feature or request label May 3, 2023
@martinbonnin
Copy link
Contributor Author

👍 I can look into that. No promises but feel free to assign it to me.

@aSemy
Copy link
Contributor

aSemy commented May 3, 2023

The Gradle config should probably be similar to how I set it up in Kotka Streams

Which ended up working for snapshots, but I didn't finish it and get regular publishing working.

I'll take a look at copying over this over and cc you into the PR.

Related to this, I'd like the project version number to be easier to update. Currently updating the version requires running a Gradle task to update the Dokkatoo version in all of the examples and tests, and the committing the update (example). I'm wary about automating a commit in a pipeline, because I want to manually verify the versions are updated correctly. Maybe there's a way of setting up a GitHub Workflow that creates a PR with the changes... just thinking out loud 🤔

@martinbonnin
Copy link
Contributor Author

martinbonnin commented May 3, 2023

Currently updating the version requires running a Gradle task to update the Dokkatoo version in all of the examples and tests

Wouldn't updating the root version automatically update all child modules thanks to some classloader magic? I even believe it's more efficient that way cause it's loading the plugin classes only once?

@aSemy
Copy link
Contributor

aSemy commented May 3, 2023

All of the Dokkatoo examples have version set as a string

d9eb584#diff-c0dfa6bc7a8685217f70a860145fbdf416d449eaff052fa28352c5cec1a98c06

I like that the examples are plain Gradle examples, and so they can be copy and pasted, but it does mean that the files need to be updated on every release.

@martinbonnin
Copy link
Contributor Author

martinbonnin commented May 3, 2023

I see. What we're doing is running a Kotlin script that sets the version and opens a PR for the new version. As part of this, it also updates docs/samples. It's served us well so far.

@hfhbd
Copy link

hfhbd commented May 24, 2023

Just curios regarding the nexus-plugin and your own publishing implementation: How do you create a staging repository and close it?

@martinbonnin
Copy link
Contributor Author

@hfhbd There's a REST API for it. It's not super well documented but you can look at this: https://github.com/martinbonnin/vespene/blob/main/vespene-lib/src/main/kotlin/net/mbonnin/vespene/lib/NexusStagingApi.kt#L31

@aSemy aSemy added the blocked-by:Gradle Blocked by a bug/missing feature in Gradle label Aug 31, 2023
@aSemy
Copy link
Contributor

aSemy commented Aug 31, 2023

I've tried adding Maven Central publishing in #116, but unfortunately the Gradle Plugin Publish Plugin causes too many issues, so this issue is blocked until Gradle can provide something that works.

@aSemy
Copy link
Contributor

aSemy commented Sep 15, 2023

I've managed to get Maven Central publishing working!

https://s01.oss.sonatype.org/content/repositories/releases/dev/adamko/dokkatoo/dokkatoo-plugin/

@aSemy aSemy closed this as completed Sep 15, 2023
@aSemy aSemy removed the blocked-by:Gradle Blocked by a bug/missing feature in Gradle label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants