Return-Path: X-Original-To: apmail-maven-commits-archive@www.apache.org Delivered-To: apmail-maven-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DD62910976 for ; Sat, 10 Aug 2013 11:56:45 +0000 (UTC) Received: (qmail 97749 invoked by uid 500); 10 Aug 2013 11:56:45 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 97549 invoked by uid 500); 10 Aug 2013 11:56:36 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 97540 invoked by uid 99); 10 Aug 2013 11:56:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Aug 2013 11:56:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Aug 2013 11:56:31 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D7B162388AB8; Sat, 10 Aug 2013 11:56:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1512657 - /maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java Date: Sat, 10 Aug 2013 11:56:10 -0000 To: commits@maven.apache.org From: dennisl@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130810115610.D7B162388AB8@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dennisl Date: Sat Aug 10 11:56:10 2013 New Revision: 1512657 URL: http://svn.apache.org/r1512657 Log: Add documentation. Modified: maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java Modified: maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java?rev=1512657&r1=1512656&r2=1512657&view=diff ============================================================================== --- maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java (original) +++ maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java Sat Aug 10 11:56:10 2013 @@ -124,9 +124,20 @@ public class GpgSigner publicKeyring = path; } + /** + * Create a detached signature file for the provided file. + * + * @param file The file to sign + * @return A reference to the generated signature file + * @throws MojoExecutionException + */ public File generateSignatureForArtifact( File file ) throws MojoExecutionException { + // ---------------------------------------------------------------------------- + // Set up the file and directory for the signature file + // ---------------------------------------------------------------------------- + File signature = new File( file + SIGNATURE_EXTENSION ); boolean isInBuildDir = false; @@ -167,6 +178,10 @@ public class GpgSigner signature.delete(); } + // ---------------------------------------------------------------------------- + // Set up the command line + // ---------------------------------------------------------------------------- + Commandline cmd = new Commandline(); if ( StringUtils.isNotEmpty( executable ) ) @@ -245,6 +260,10 @@ public class GpgSigner cmd.createArg().setFile( file ); + // ---------------------------------------------------------------------------- + // Execute the command line + // ---------------------------------------------------------------------------- + try { int exitCode = CommandLineUtils.executeCommandLine( cmd, in, new DefaultConsumer(), new DefaultConsumer() );