This document describes how to publish a new version to Maven Central.
Sonatype account — Register at central.sonatype.com if you haven’t already. You need publishing rights for the com.yanimetaxas group ID.
gpg --gen-key
gpg --keyserver keyserver.ubuntu.com --send-keys YOUR_KEY_ID
~/.m2/settings.xml:
<settings>
<servers>
<server>
<id>central</id>
<username>YOUR_SONATYPE_USERNAME</username>
<password>YOUR_SONATYPE_TOKEN</password>
</server>
</servers>
</settings>
Generate a user token at central.sonatype.com → Account → Generate User Token.
CODECOV_TOKEN as a GitHub repository secret. Get the token from codecov.io after linking the repository.Pushing a v* tag runs .github/workflows/release.yml. The workflow sets the Maven version from the tag, runs the full verification, signs the artifacts, and publishes these modules to Maven Central:
bookkeeping-corebookkeeping-jdbcbookkeeping-spring-boot-starterbookkeeping-examples and bookkeeping-coverage are not published. The workflow then creates a GitHub Release for that tag and attaches the three published JARs.
Add these repository secrets before the first tag:
| Secret | Purpose |
|---|---|
MAVEN_CENTRAL_USERNAME |
Sonatype user-token username |
MAVEN_CENTRAL_TOKEN |
Sonatype user-token password |
MAVEN_GPG_PRIVATE_KEY |
Armored private key (gpg --export-secret-keys --armor KEY_ID) |
MAVEN_GPG_PASSPHRASE |
Passphrase for that key |
git tag v1.0.0
git push origin v1.0.0
mvn -T 1C clean verify -P sign
This runs all tests, generates sources/javadoc JARs, signs artifacts with GPG, and generates a JaCoCo coverage report. Fix any issues before proceeding.
Update pom.xml with the release version (remove -SNAPSHOT if present):
<version>1.0.0</version>
mvn clean deploy -P sign,release
This will:
central-publishing-maven-pluginAfter deployment, check that the artifact appears at:
It may take 10-30 minutes for the artifact to sync to Maven Central search.
git tag v1.0.0
git push origin v1.0.0
Then create a release on GitHub at: https://github.com/imetaxas/double-entry-bookkeeping-api/releases/new
Select the tag, write release notes (reference CHANGELOG.md), and publish.
pom.xml to the next snapshot version:
<version>1.0.1-SNAPSHOT</version>
If you prefer automated version management:
# Prepare: bumps version, commits, tags
mvn release:clean release:prepare
# Perform: checks out the tag, builds, and deploys
mvn release:perform -Darguments="-P sign,release"
If prepare fails:
mvn release:rollback
mvn release:clean
GPG signing fails:
export GPG_TTY=$(tty) # Fix for GPG passphrase prompt
gpg --list-keys # Verify key exists
401 Unauthorized on deploy:
~/.m2/settings.xml has the correct <server> entry with id centralArtifact not appearing on Maven Central:
If you previously published via the legacy oss.sonatype.org and need to migrate, see: Sonatype Central Migration Guide.