Simple note on how to publish jardiff to Maven Central.
This project follows Semantic Versioning:
Make the release on GitHub releases, publish it.
# Get latest tag
git pull
# Ensure clean working directory
git status
# Ensure build passes
./gradlew clean buildEventually inspect the deployment:
./gradlew nmcpZipAggregation
# Inspect the zip in build/nmcp/zip/aggregation.zipAlso, each published modules have their expanded form in build/nmcp/m2/io/github/bric3/jardiff/.
./gradlew nmcpPublishAggregationToMavenLocal
# Inspect the publication in ~/.m2/repository/io/github/bric3/jardiff/This project uses nmcp plugin. Following example
- uses 1Password to get secrets (ids are fake), but other tool may apply
- uses file based signing
./gradlew publishAggregationToCentralPortal \
-PmavenCentralUsername=$(op item get "central" --fields publication.username) \
-PmavenCentralPassword=$(op item get "central" --fields publication.password --reveal) \
-Psigning.secretKeyRingFile=$HOME/.gnupg/secring.gpg \
-Psigning.password="$(op item get "gpg" --field passphrase --reveal)" \
-Psigning.keyId=gpg-short-key-idCheck Maven Central: https://search.maven.org/artifact/io.github.bric3.jardiff/jardiff
If you need to set up GPG:
# List keys and note the key ID
gpg --list-secret-keys --keyid-format=short
# Export secret keyring
gpg --export-secret-keys > ~/.gnupg/secring.gpg- 1Password authentication expired: Run
op signinagain - Invalid credentials: Verify 1Password item names and field names
- Signing failed: Verify GPG key ID and passphrase are correct
- Sync delay: Maven Central sync can take 15-30 minutes after publication