You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2013/08/10 13:56:10 UTC
svn commit: r1512657 -
/maven/plugins/trunk/maven-gpg-plugin/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
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() );