This document describes the release process for publishing new versions to Maven Central.
Ensure the following GitHub secrets are configured:
GPG_KEY- ASCII-armoured GPG private key for signing artifactsGPG_PASSPHRASE- Passphrase for the GPG keyOSSRH_USERNAME- Sonatype OSSRH usernameOSSRH_PASSWORD- Sonatype OSSRH password or token
The maven-central GitHub environment must be configured with appropriate
approval gates.
- All tests pass on the main branch
- Version in
pom.xmlis currently a SNAPSHOT version (e.g.,1.0.4-SNAPSHOT) - All changes for this release have been merged to main
- CHANGELOG or release notes are prepared (if applicable)
Update pom.xml to remove the -SNAPSHOT suffix:
<version>1.0.4</version>Commit the change:
git commit -am "Update version to 1.0.4"
git push origin mainCreate a tag matching the version with a v prefix:
git tag v1.0.4
git push origin v1.0.4This triggers the draft-release.yml workflow, which:
- Verifies the version is not a SNAPSHOT
- Creates a draft GitHub release
- Navigate to the Releases page on GitHub
- Find the draft release created by the workflow
- Review the release details and add release notes if desired
- Click Publish release
Publishing triggers the release.yml workflow, which:
- Signs artifacts with GPG
- Deploys to Maven Central via the
central-publishing-maven-plugin - Auto-publishes to Maven Central
After the workflow completes:
- Check the GitHub Actions page to confirm the workflow succeeded
- Verify the artifacts appear on Maven Central (may take up to 30 minutes to sync)
Update pom.xml to the next SNAPSHOT version:
<version>1.0.5-SNAPSHOT</version>Commit and push:
git commit -am "Update version to 1.0.5-SNAPSHOT"
git push origin mainThe pom.xml version must not contain -SNAPSHOT when the tag is pushed.
Ensure you committed the version update before creating the tag.
- Check the workflow logs for specific error messages
- Verify all secrets are correctly configured
- Ensure the GPG key has not expired
- Check Sonatype OSSRH credentials are valid
- Maven Central sync can take up to 30 minutes
- Check the Sonatype Central Portal for deployment status
- Verify the
release.ymlworkflow completed successfully
If deployment failed after the tag was created:
- Fix the underlying issue
- Delete the tag locally and remotely:
git tag -d v1.0.4 git push origin :refs/tags/v1.0.4
- Delete the draft/failed GitHub release
- Re-create and push the tag
To deploy a SNAPSHOT version for testing:
- Ensure the
pom.xmlversion ends with-SNAPSHOT - Navigate to Actions > "Deploy Maven snapshot"
- Click Run workflow
- Select the branch to deploy from
- Click Run workflow
Snapshots are deployed to the Sonatype snapshots repository and do not require a GitHub release.