feat(maven): publish both artifacts to maven central - #630
Merged
Conversation
GitHub Packages demands `read:packages` even to read a public artifact, so f-droid — which builds from source with no credentials — cannot resolve either artifact from it. That is the whole reason the AAR exists, so it has to be somewhere credential-less. `app.opendocument` is already a live namespace on Central (`pdf2htmlex-android`, `wvware-android`, both since 2024), so this is a new artifact under an old name. The AAR goes through `com.vanniktech.maven.publish`; sonatype ships no official gradle plugin for the portal and OSSRH, which the org's earlier android libraries deployed to, is gone. The publication is renamed `release` -> `maven` by the plugin, hence the workflow now asks for `publishAllPublicationsToGitHubPackagesRepository`. The jar keeps its hand-written pom and gets a `central` profile, because `central-publishing-maven-plugin` takes over the deploy lifecycle wholesale and the two destinations cannot be driven by one invocation. Central asks for more than GitHub Packages: sources and javadoc jars, a pom carrying `developers` (neither had one), and a PGP signature per file. Signing is conditional on a key being configured — unconditional would mean no `publishToMavenLocal` and no GitHub Packages publish without a private key on hand, and the portal rejects an unsigned upload anyway. Both publishes upload and stop; releasing is a click, because Central never forgets a version. Verified locally against a throwaway PGP key: the AAR publishes with .aar/.pom/.module plus sources and javadoc, each with a valid detached .asc, and still publishes unsigned when no key is set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QqTNzXTxzfeCA2w1ErQzax
andiwand
force-pushed
the
feat/maven-central
branch
from
July 30, 2026 18:21
2699811 to
4eea81b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #629.
GitHub Packages demands
read:packageseven to read a public artifact. f-droid builds from source with no credentials at all, so it cannot resolve either artifact from there — and being consumable by droid, which f-droid builds, is the whole reason the AAR exists. #629 says this needs Maven Central "first, which is a separate piece of work — theapp.opendocumentnamespace has to be verified, and every artifact signed." Half of that turned out to be already done.app.opendocumentis not a new namespaceThe org has published android AARs to Maven Central before, under exactly this group:
app.opendocument:pdf2htmlex-androidapp.opendocument:wvware-androidBoth are on
repo1.maven.orgtoday, and droid consumed them as ordinarymavenCentral()dependencies before they were archived. So this is a new artifact under an established name. What is genuinely outstanding is credentials, not verification — see below.What this changes
The AAR goes through
com.vanniktech.maven.publish. Sonatype ships no official gradle plugin for the Central Portal, and OSSRH — whichpdf2htmlEX-Androidandwvware-androiddeployed to — is gone, so theirgradle-nexus/publish-plugin+s01.oss.sonatype.orgsetup cannot simply be copied. vanniktech is what android libraries have settled on. It renames the publicationrelease→maven, so the workflow now asks for the name-independentpublishAllPublicationsToGitHubPackagesRepository.The jar keeps its hand-written pom and gains a
centralprofile.central-publishing-maven-plugintakes over the deploy lifecycle wholesale, so onemvn deploycannot serve both destinations; the default stays GitHub Packages and-Pcentralis the Central path.maven.ymlsplits publishing into its own job so the secrets sit behind an environment, the shapeandroid.ymlalready has.Both keep publishing to GitHub Packages. Nothing that reads it today breaks.
Central asks for more than GitHub Packages does, and both artifacts now supply it:
developers— neither had one, so neither would have been accepted as it stood;Signing is conditional on a key being configured. Unconditional (
signAllPublications()on its own) failspublishToMavenLocalwith "no configured signatory", which would mean nobody could publish locally or to GitHub Packages without a private key on hand — a steep price for two destinations that never check one. The portal rejects an unsigned upload, so the release path stays guarded.Both publishes upload a deployment and stop. Releasing is a deliberate click in the portal UI: Central never forgets a version, and that click is the last point at which a bad artifact can be dropped rather than lived with.
Verification
Locally, against a throwaway PGP key: the AAR publishes
.aar,.pom,.module, sources and javadoc jars, each with a detached.ascthat verifies against the key; the POM carries name, description, url, licenses, developers and scm; the AAR still contains its assets and prebuilt ABIs. With no key set it publishes the same artifacts unsigned.mvn verifyandmvn validate -Pcentralboth pass, and the flattened pom keepsdevelopers.Not verified: an actual upload to the portal, which needs credentials this repo does not have yet.
Before this can release
The
maven-centralenvironment has to exist with four secrets:MAVEN_CENTRAL_USERNAME/MAVEN_CENTRAL_PASSWORDSIGNING_KEYSIGNING_PASSThe archived repos hold a working
SIGNING_KEY/SIGNING_PASSpair in their ownOpenDocumentAppReleaseenvironment, so the signing key may just need copying. The Sonatype credentials do not carry over: those are OSSRH-era, and the Portal issues its own tokens. Worth confirming who holds the Portal account that owns theapp.opendocumentnamespace, since these repos came from an outside author.🤖 Generated with Claude Code