1.5 KiB
1.5 KiB
Build Instructions
Building locally
mvn clean install
GPG signing and Maven Central publishing are only active in the release profile, so no GPG key is needed for normal builds.
Deploying
-
Internal Artifactory (
https://maven.duxtechnica.org/repository/..., configured indistributionManagement; credentials come from theinternal-release/internal-snapshotserver ids insettings.xml):mvn clean deployVersions ending in
-SNAPSHOTgo to the snapshot repo, all others to the release repo. -
Maven Central (signed; requires a GPG key and the
centralserver id insettings.xml):mvn clean deploy -Prelease
GPG signing error (historical)
Before signing was moved to the release profile, mvn clean install without a GPG key failed with:
gpg: no default secret key: No secret key
gpg: signing failed: No secret key
Cause
maven-gpg-plugin ran the sign goal in the verify phase on every build. It now lives in the release profile in pom.xml, so it only runs with -Prelease.
If you use -Prelease
- Check for existing keys:
gpg --list-secret-keys - Import a key (
gpg --import private.key) or generate one (gpg --gen-key) - With multiple keys, select one:
-Dgpg.keyname=<KEYID> - The pom passes
--pinentry-mode loopback, so the passphrase can be supplied with-Dgpg.passphrase=.... Prefersettings.xmlor an environment variable over the command line. - To run the profile without signing:
-Dgpg.skip=true