You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2019/04/05 17:42:00 UTC

[maven-gpg-plugin] branch INFRA-18014 updated: Add logging

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch INFRA-18014
in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git


The following commit(s) were added to refs/heads/INFRA-18014 by this push:
     new b415bce  Add logging
b415bce is described below

commit b415bceb201d29f163e0e69718be695276fdc059
Author: rfscholte <rf...@apache.org>
AuthorDate: Fri Apr 5 19:41:51 2019 +0200

    Add logging
---
 src/it/sign-release/{verify.bsh => verify.groovy}  | 24 +++++++++-------------
 .../org/apache/maven/plugin/gpg/GpgSigner.java     |  2 ++
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/it/sign-release/verify.bsh b/src/it/sign-release/verify.groovy
similarity index 70%
rename from src/it/sign-release/verify.bsh
rename to src/it/sign-release/verify.groovy
index 495669e..ee60058 100644
--- a/src/it/sign-release/verify.bsh
+++ b/src/it/sign-release/verify.groovy
@@ -18,27 +18,23 @@
  * under the License.
  */
 
-import java.io.*;
+import groovy.io.FileType
 
-File artifactDir = new File( localRepositoryPath, "org/apache/maven/its/gpg/sr/test/1.0" );
+def buildLog = new File(basedir,'build.log')
+assert buildLog.text.contains('BUILD SUCCESS')
 
-String[] expectedFiles = {
+def artifactDir = new File( localRepositoryPath, "org/apache/maven/its/gpg/sr/test/1.0" )
+
+def expectedFiles = [
     "test-1.0.pom",
     "test-1.0.pom.asc",
     "test-1.0.jar",
     "test-1.0.jar.asc",
     "test-1.0-sources.jar",
     "test-1.0-sources.jar.asc",
-};
-
-for ( String expectedFile : expectedFiles )
-{
-    File file = new File( artifactDir, expectedFile );
+] as Set
 
-    System.out.println( "Checking for existence of " + file );
+def actualFiles = [] as Set 
+artifactDir.eachFile(FileType.FILES) { actualFiles << it.name }
 
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
-    }
-}
+assert expectedFiles == (actualFiles - '_remote.repositories')
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java b/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
index cf4dc73..7ad6831 100644
--- a/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
+++ b/src/main/java/org/apache/maven/plugin/gpg/GpgSigner.java
@@ -159,6 +159,8 @@ public class GpgSigner
         // Execute the command line
         // ----------------------------------------------------------------------------
 
+        getLog().debug( "Executing: " + cmd.toString() );
+
         try
         {
             int exitCode = CommandLineUtils.executeCommandLine( cmd, in, new DefaultConsumer(), new DefaultConsumer() );