Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Better defaults for artifact signing #25

Merged
merged 1 commit into from
Jun 8, 2014

Conversation

ept
Copy link
Contributor

@ept ept commented May 12, 2014

Thank you for gradle-nexus-plugin! It makes publishing to Sonatype OSS beautifully simple.

However, I'm not willing to put my GPG passphrase in a plaintext file, so I played around a bit with the signing configuration.

This patch doesn't change anything if the signing.keyId, signing.secretKeyRingFile and signing.password properties are configured, but it provides better defaults if they are not configured:

  • If signing.keyId is missing, a more helpful error message is shown, explaining to the user how they can configure the property.
  • If signing.secretKeyRingFile is missing, it defaults to the default location of GnuPG's secret keyring file on Unix-like systems.
  • If signing.password is missing, it prompts the user. This avoids having to store your GPG passphrase in an unencrypted file on disk.

This is my first time attempting any custom Gradle build configuration, so my approach may be way off — if so, I'd love to see how to do this better :)

Also, sorry for lack of tests. gradle-nexus-plugin's integration tests fail for me (even before making any changes), so I wasn't sure where to start.

This patch doesn't change anything if the signing.keyId,
signing.secretKeyRingFile and signing.password properties are
configured, but it provides better defaults if they are not configured:

- If signing.keyId is missing, a more helpful error message is shown,
  explaining to the user how they can configure the property.
- If signing.secretKeyRingFile is missing, it defaults to the default
  location of GnuPG's secret keyring file on Unix-like systems.
- If signing.password is missing, it prompts the user. This avoids
  having to store your GPG passphrase in an unencrypted file on disk.

This is my first time attempting any custom Gradle build configuration,
so my approach may be way off -- if so, I'd love to see how to do this
better :)

Also, sorry for lack of tests. gradle-nexus-plugin's integration tests
fail for me (even before making any changes), so I wasn't sure where to
start.
@bmuschko bmuschko merged commit f3d23a1 into bmuschko:master Jun 8, 2014
@bmuschko bmuschko added this to the v0.7.1 milestone Jun 8, 2014
@bmuschko bmuschko self-assigned this Jun 8, 2014
@bmuschko
Copy link
Owner

bmuschko commented Jun 8, 2014

Thanks for your contribution. It has been merged.

@shadycuz
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants