title: Avoid gpg signing prompt when using Maven release plugin
body: <p>I've got a Maven project that I'm trying to configure to use the maven release plugin.  Part of the release process is to use the Maven GPG Plugin to sign artifacts which requires among other things, the GPG signing key passphrase to succeed.  Because these builds need to be runnable in a non interactive environment, (CI-Server) these params are passed in as arguments to maven in the form of</p>
  <pre><code>-Dgpg.passphrase=XXX
  </code></pre>
  <p>For snapshot builds everything works fine; the Maven GPG Plugin sees the passed in passphrase, artifacts are built, signed and deployed as expected, however, when I try to use the release plugin I get prompted for the gpg signing key password.  I've read through several discussions on similar issues that stem from the release plugin forking another invocation of maven which does not receive the passed in params.  The most popular fix seems to be to use the &quot;arguments&quot; parameter like this:</p>
  <pre><code>-Darguments=&quot;-Dgpg.passphrase=XXX&quot;
  </code></pre>
  <p>Supposedly this gets passed to the forked instance but unfortunately for me it's not getting rid of the prompt.</p>
  <p>Since signing artifacts is not an uncommon prerequisite for deploying release artifacts to public maven repos and presumably most entities producing those artifacts are using some form of CI I can't imagine I'm the only person who has encountered this problem.  Has anybody found a workaround?</p>
  <p><strong>A NOTE ABOUT THE ACCEPTED ANSWER:</strong></p>
  <p>The accepted solution will -not- work with Maven 3.0 - 3.0.3 and 3.0.3 just so happens to be what installs by default with java on OSX Mountain Lion.  You'll need to upgrade to 3.0.4.</p>