Skip to content

Latest commit

 

History

History
78 lines (53 loc) · 2.01 KB

File metadata and controls

78 lines (53 loc) · 2.01 KB

Publishing Guide

Simple note on how to publish jardiff to Maven Central.

Version Numbering

This project follows Semantic Versioning:

Release Process

Make the release on GitHub releases, publish it.

1. Prepare the release

# Get latest tag
git pull
# Ensure clean working directory
git status

# Ensure build passes
./gradlew clean build

Eventually inspect the deployment:

./gradlew nmcpZipAggregation
# Inspect the zip in build/nmcp/zip/aggregation.zip

Also, 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/

2. Publish to Maven Central

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-id

5. Verify Publication

Check Maven Central: https://search.maven.org/artifact/io.github.bric3.jardiff/jardiff

GPG Signing Setup

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

Troubleshooting

  • 1Password authentication expired: Run op signin again
  • 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