This document describes how to publish xesar-connect to Maven Central via Sonatype.
brew install gpgImport your public and private keys, then export the secret keyring:
gpg --import public-key.asc
gpg --import private-key.asc
gpg --list-secret-keys # note the last 8 characters of the key ID
gpg --export-secret-keys -o ~/.gnupg/secring.gpgObtain the Sonatype credentials and GPG passphrase from our OpenBao instance.
Add the following to ~/.gradle/gradle.properties:
ossrhUsername=<sonatype-username>
ossrhPassword=<sonatype-password>
signing.keyId=<last-8-chars-of-gpg-key-id>
signing.password=<gpg-passphrase>
signing.secretKeyRingFile=/Users/<you>/.gnupg/secring.gpgFirst, check the current version in gradle.properties. It should look like this:
version=2.2.0-SNAPSHOTRemove the -SNAPSHOT suffix to set the release version:
version=2.2.0./gradlew spotlessApply test prepareMavenPublishThis will:
- Format the code
- Run all tests
- Build, sign, and publish artifacts to
build/xesar-connect-artifact/ - Create a ZIP archive in
build/
Manually upload the generated ZIP file from the build/ directory to the Sonatype Central Portal.
git commit -am "release: v2.2.0"
git tag v2.2.0
git push origin main --tagsIn gradle.properties, bump the version and add the -SNAPSHOT suffix back:
version=2.2.1-SNAPSHOTThis ensures that ongoing development builds are clearly marked as unreleased snapshots.
git commit -am "chore: bump version to 2.2.1-SNAPSHOT"
git push origin main