minor cleanup and changes to the build process
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# 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 in `distributionManagement`; credentials come from the `internal-release` / `internal-snapshot` server ids in `settings.xml`):
|
||||
```
|
||||
mvn clean deploy
|
||||
```
|
||||
Versions ending in `-SNAPSHOT` go to the snapshot repo, all others to the release repo.
|
||||
|
||||
- **Maven Central** (signed; requires a GPG key and the `central` server id in `settings.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](./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=...`. Prefer `settings.xml` or an environment variable over the command line.
|
||||
- To run the profile without signing: `-Dgpg.skip=true`
|
||||
Reference in New Issue
Block a user