Skip to content

ci: publish to Maven Central without a manual click - #2

Merged
michaeldoehler merged 1 commit into
mainfrom
maven-autopublish
Sep 13, 2026
Merged

michaeldoehler merged 1 commit into
mainfrom
maven-autopublish

Conversation

@michaeldoehler

Copy link
Copy Markdown
Contributor

autoPublish. The central-publishing plugin otherwise leaves a deployment in the portal as validated and waits for someone to press Publish. A release here is already gated on a green suite and on the tag matching the version, so that click is a place to forget rather than a decision.

waitUntil=published. Without it the build reports success as soon as the upload is accepted, and a deployment the portal later rejects sits there silently. Now the build fails with it.

The version gate, like the other SDKs: the job refuses a tag that disagrees with project.version. Maven Central never lets a version be replaced.

The pom.xml was already complete for Central: name, description, url, licenses, developers, scm, plus the sources and javadoc plugins and GPG signing in the release profile.

Still needed before this can run (the heavy part of Maven Central, all on your side):

  1. Namespace. central.sonatype.com → Namespaces → add com.camelmailer, then publish the verification code it gives you as a DNS TXT record on camelmailer.com and hit Verify.
  2. GPG key, published to a keyserver, because Central only takes signed artifacts.
  3. Four secrets: MAVEN_CENTRAL_USERNAME, MAVEN_CENTRAL_PASSWORD (a portal user token, not your login), MAVEN_GPG_PRIVATE_KEY (the full ASCII-armoured block), MAVEN_GPG_PASSPHRASE.

The central-publishing plugin leaves a deployment in the portal as
"validated" and waits for someone to press Publish. A release here is
already gated on a green suite and on the tag matching the version, so
that click is a place to forget rather than a decision. autoPublish takes
it, and waitUntil=published makes the build fail when the portal rejects
the deployment instead of reporting success on something stuck.

Adds the same tag-versus-version gate the other SDKs now carry. Maven
Central never lets a version be replaced.
@michaeldoehler
michaeldoehler merged commit f83f7ce into main Sep 13, 2026
2 checks passed
@michaeldoehler
michaeldoehler deleted the maven-autopublish branch September 13, 2026 22:09
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.

1 participant