utils-java publishes non-SNAPSHOT releases to Maven Central through the
Central Publisher Portal.
Before the release workflow can succeed:
- the
media.barneynamespace must be verified in the Central Publisher Portal - a Central Portal user token must be generated for the publishing account
- a GPG key pair must exist and the public key must be published to a supported keyserver
Configure these repository secrets:
CENTRAL_USERNAME: Central Publisher Portal user token usernameCENTRAL_PASSWORD: Central Publisher Portal user token passwordCENTRAL_GPG_PRIVATE_KEY: ASCII-armored private key used to sign artifactsCENTRAL_GPG_PASSPHRASE: passphrase for the private key
- Make sure
maincontains the release-ready code. - Create an annotated tag using the release version prefixed with
v, for examplev0.1.0. - Push the tag to GitHub.
- The
Release to Maven Centralworkflow derives the Maven version from the tag, runs./mvnw -Prelease deploy, signs the artifacts, and publishes them via the Central Publisher Portal.
The project keeps 0.0.1-SNAPSHOT as the default local development version and
overrides revision during tagged releases.
You can validate the release profile locally without publishing by running:
.\mvnw.cmd -B -ntp -Prelease -Drevision=0.1.0 -Dscm.tag=v0.1.0 -Dcentral.skipPublishing=true deployThis still requires:
- a usable GPG private key in the local keyring
Maven Central is immutable. Once a version is published, do not reuse or overwrite it.
If a release fails before the publish step completes, fix the workflow inputs or configuration and publish a new version.
If a bad version is already visible on Maven Central, publish a newer version with the fix and leave the original artifact in place.