Skip to content

chore: publish to Maven Central - #48

Merged
martinbonnin merged 6 commits into
paug:mainfrom
4rthurRousseau:chore/publish_to_maven_central
Mar 30, 2026
Merged

chore: publish to Maven Central#48
martinbonnin merged 6 commits into
paug:mainfrom
4rthurRousseau:chore/publish_to_maven_central

Conversation

@4rthurRousseau

@4rthurRousseau 4rthurRousseau commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

This PR sets up the project for publication to Maven Central using the Librarian library (fixes #47).

I upgraded Librarian from 0.0.7 to 0.2.1 to use the latest publication API and target Maven Central (see GradleUp/librarian#55).

Following the upgrade, I had to change the Gradle task used to build Dokka documentation as Librarian switched from Dokkatoo to Dokka its 0.2.0 version (GradleUp/librarian#97).

Both LIBRARIAN_SONATYPE_USERNAME and LIBRARIAN_SONATYPE_PASSWORD secrets will probably need to be updated.

Important note :
I had to add the Dokka plugin to both sample-app-android and sample-app-shared due to it being applied inside the Librarian plugin. The build fails without it, but in the current state, the sample-app-shared and sample-app-android documentation are published with the library documentation.

I feel like it should not be necessary regarding the comment in the librarianModule extension method :

/**
* Only configure Dokka for projects that are published.
* This is because we don't want those in the aggregate KDoc output.
*/

I wonder if this has something to do with the Librarian.root method that seems to configure the Dokka aggregate using allprojects (without checking whether publication is enabled or not).

I'm not confident with the Librarian library, so let me know if I'm mistaken @martinbonnin ! 🙂

martinbonnin added a commit to GradleUp/librarian that referenced this pull request Mar 29, 2026
@martinbonnin

Copy link
Copy Markdown
Collaborator

Thanks for looking into this. Gradle aggregations are a massive pain... I'll dig more tomorrow.

@martinbonnin

Copy link
Copy Markdown
Collaborator

I ended up modifying librarian to explicitely list subprojects. This is not great but I don't think there is another way (see also Kotlin/dokka#4489).

Thanks for the nudge on this 🙏

@martinbonnin
martinbonnin merged commit d8720e6 into paug:main Mar 30, 2026
1 check passed
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.

Migrate publishing from OSSRH to Maven Central Portal

2 participants