You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2023/04/15 00:47:57 UTC

[maven-gpg-plugin] branch MGPG-94 updated: [MGPG-94] Integration tests - convert and reformat bsh to groovy

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

slachiewicz pushed a commit to branch MGPG-94
in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git


The following commit(s) were added to refs/heads/MGPG-94 by this push:
     new 9ffe0db  [MGPG-94] Integration tests - convert and reformat bsh to groovy
9ffe0db is described below

commit 9ffe0dbe56efff92ca8a1e7718c31a4bb763e303
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat Apr 15 02:47:43 2023 +0200

    [MGPG-94] Integration tests - convert and reformat bsh to groovy
---
 pom.xml                                            |  5 ++
 .../verify.groovy}                                 | 21 ++++++--
 .../verify.bsh => no-main-artifact/verify.groovy}  | 28 +++++------
 .../setup.groovy}                                  |  6 +--
 .../verify.groovy}                                 | 34 ++++++-------
 .../{setup.bsh => setup.groovy}                    |  7 ++-
 .../{verify.bsh => verify.groovy}                  | 24 ++++-----
 .../{setup.bsh => setup.groovy}                    |  7 +--
 .../{verify.bsh => verify.groovy}                  | 24 ++++-----
 .../setup.groovy}                                  |  7 +--
 .../{verify.bsh => verify.groovy}                  | 24 ++++-----
 src/it/sign-and-deploy-not-jar-packaging/setup.bsh | 24 ---------
 .../setup.groovy}                                  |  7 +--
 .../verify.groovy}                                 | 18 +++++--
 src/it/sign-release-with-excludes/verify.bsh       | 58 ----------------------
 .../verify.groovy}                                 | 38 +++++++-------
 .../{verify.bsh => verify.groovy}                  | 19 +++----
 src/it/sign-release/verify.bsh                     | 44 ----------------
 .../verify.bsh => sign-release/verify.groovy}      | 24 ++++-----
 .../verify.bsh                                     | 42 ----------------
 .../verify.groovy}                                 | 24 ++++-----
 21 files changed, 150 insertions(+), 335 deletions(-)

diff --git a/pom.xml b/pom.xml
index aa8aa25..6a3e857 100644
--- a/pom.xml
+++ b/pom.xml
@@ -189,6 +189,11 @@ under the License.
             </excludes>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-invoker-plugin</artifactId>
+          <version>3.5.1</version>
+        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>
diff --git a/src/it/sign-and-deploy-file-with-pom/setup.bsh b/src/it/alternative-secret-keyring/verify.groovy
similarity index 64%
copy from src/it/sign-and-deploy-file-with-pom/setup.bsh
copy to src/it/alternative-secret-keyring/verify.groovy
index 03bc9f0..652827c 100644
--- a/src/it/sign-and-deploy-file-with-pom/setup.bsh
+++ b/src/it/alternative-secret-keyring/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +16,22 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+def artifactDir = new File(localRepositoryPath, "org/apache/maven/its/gpg/nma/test/1.0")
+
+def expectedFiles = [
+        "test-1.0.pom",
+        "test-1.0.pom.asc",
+        "test-1.0-jdk15.jar",
+        "test-1.0-jdk15.jar.asc"
+]
+
+expectedFiles.each { expectedFile ->
+    def file = new File(artifactDir, expectedFile)
+
+    println "Checking for existence of $file"
 
-import java.io.*;
-import org.codehaus.plexus.util.*;
+    if (!file.isFile()) {
+        throw new Exception("Missing file $file")
+    }
+}
 
-FileUtils.deleteDirectory( new File( basedir, "target" ) );
diff --git a/src/it/sign-and-deploy-not-jar-packaging/verify.bsh b/src/it/no-main-artifact/verify.groovy
similarity index 64%
rename from src/it/sign-and-deploy-not-jar-packaging/verify.bsh
rename to src/it/no-main-artifact/verify.groovy
index e52bdcb..8dc2d1b 100644
--- a/src/it/sign-and-deploy-not-jar-packaging/verify.bsh
+++ b/src/it/no-main-artifact/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -18,23 +17,22 @@
  * under the License.
  */
 
-import java.io.*;
-
-File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadnjp/test/1.0" );
+def artifactDir = new File(localRepositoryPath, "org/apache/maven/its/gpg/nma/test/1.0")
 
-String[] expectedFiles = {
-    "test-1.0-javadoc.jar",
-    "test-1.0-javadoc.jar.asc",
-};
+def expectedFiles = [
+        "test-1.0.pom",
+        "test-1.0.pom.asc",
+        "test-1.0-jdk15.jar",
+        "test-1.0-jdk15.jar.asc"
+]
 
-for ( String expectedFile : expectedFiles )
-{
-    File file = new File( artifactDir, expectedFile );
+for (String expectedFile : expectedFiles) {
+    def file = new File(artifactDir, expectedFile)
 
-    System.out.println( "Checking for existence of " + file );
+    println "Checking for existence of $file"
 
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
+    if (!file.isFile()) {
+        throw new Exception("Missing file $file")
     }
 }
+
diff --git a/src/it/sign-and-deploy-files/setup.bsh b/src/it/sign-and-deploy-file-with-extras/setup.groovy
similarity index 87%
rename from src/it/sign-and-deploy-files/setup.bsh
rename to src/it/sign-and-deploy-file-with-extras/setup.groovy
index 03bc9f0..a842ab6 100644
--- a/src/it/sign-and-deploy-files/setup.bsh
+++ b/src/it/sign-and-deploy-file-with-extras/setup.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -18,7 +17,6 @@
  * under the License.
  */
 
-import java.io.*;
-import org.codehaus.plexus.util.*;
+import org.codehaus.plexus.util.FileUtils
 
-FileUtils.deleteDirectory( new File( basedir, "target" ) );
+FileUtils.deleteDirectory(new File(basedir, "target"))
diff --git a/src/it/sign-and-deploy-file-with-pom/verify.bsh b/src/it/sign-and-deploy-file-with-extras/verify.groovy
similarity index 58%
copy from src/it/sign-and-deploy-file-with-pom/verify.bsh
copy to src/it/sign-and-deploy-file-with-extras/verify.groovy
index 909ce13..9023ee2 100644
--- a/src/it/sign-and-deploy-file-with-pom/verify.bsh
+++ b/src/it/sign-and-deploy-file-with-extras/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -18,25 +17,26 @@
  * under the License.
  */
 
-import java.io.*;
-
-File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadfwp/test/1.0" );
+def artifactDir = new File(basedir, "target/repo/org/apache/maven/its/gpg/sadfwe/test/1.0")
 
-String[] expectedFiles = {
-    "test-1.0.jar",
-    "test-1.0.jar.asc",
-    "test-1.0.pom",
-    "test-1.0.pom.asc",
-};
+var expectedFiles = [
+        "test-1.0.jar",
+        "test-1.0.jar.asc",
+        "test-1.0-sources.jar",
+        "test-1.0-sources.jar.asc",
+        "test-1.0-javadoc.jar",
+        "test-1.0-javadoc.jar.asc",
+        "test-1.0.pom",
+        "test-1.0.pom.asc"
+]
 
-for ( String expectedFile : expectedFiles )
-{
-    File file = new File( artifactDir, expectedFile );
+for (String expectedFile : expectedFiles) {
+    var file = new File(artifactDir, expectedFile)
 
-    System.out.println( "Checking for existence of " + file );
+    println "Checking for existence of $file"
 
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
+    if (!file.isFile()) {
+        throw new Exception("Missing file $file")
     }
 }
+
diff --git a/src/it/sign-and-deploy-file-with-pom/setup.bsh b/src/it/sign-and-deploy-file-with-pom/setup.groovy
similarity index 87%
copy from src/it/sign-and-deploy-file-with-pom/setup.bsh
copy to src/it/sign-and-deploy-file-with-pom/setup.groovy
index 03bc9f0..a879aef 100644
--- a/src/it/sign-and-deploy-file-with-pom/setup.bsh
+++ b/src/it/sign-and-deploy-file-with-pom/setup.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -18,7 +17,7 @@
  * under the License.
  */
 
-import java.io.*;
-import org.codehaus.plexus.util.*;
 
-FileUtils.deleteDirectory( new File( basedir, "target" ) );
+import org.codehaus.plexus.util.FileUtils
+
+FileUtils.deleteDirectory(new File(basedir, "target"))
diff --git a/src/it/sign-and-deploy-file-with-pom/verify.bsh b/src/it/sign-and-deploy-file-with-pom/verify.groovy
similarity index 67%
rename from src/it/sign-and-deploy-file-with-pom/verify.bsh
rename to src/it/sign-and-deploy-file-with-pom/verify.groovy
index 909ce13..19bb184 100644
--- a/src/it/sign-and-deploy-file-with-pom/verify.bsh
+++ b/src/it/sign-and-deploy-file-with-pom/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,26 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+var artifactDir = new File(basedir, "target/repo/org/apache/maven/its/gpg/sadfwp/test/1.0")
 
-import java.io.*;
-
-File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadfwp/test/1.0" );
-
-String[] expectedFiles = {
+var expectedFiles = [
     "test-1.0.jar",
     "test-1.0.jar.asc",
     "test-1.0.pom",
-    "test-1.0.pom.asc",
-};
+    "test-1.0.pom.asc"
+]
 
-for ( String expectedFile : expectedFiles )
-{
-    File file = new File( artifactDir, expectedFile );
+for (String expectedFile : expectedFiles) {
+    var file = new File(artifactDir, expectedFile)
 
-    System.out.println( "Checking for existence of " + file );
+    println "Checking for existence of $file"
 
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
+    if (!file.isFile()) {
+        throw new Exception("Missing file $file")
     }
 }
diff --git a/src/it/sign-and-deploy-file-without-pom/setup.bsh b/src/it/sign-and-deploy-file-without-pom/setup.groovy
similarity index 87%
rename from src/it/sign-and-deploy-file-without-pom/setup.bsh
rename to src/it/sign-and-deploy-file-without-pom/setup.groovy
index 03bc9f0..b642e65 100644
--- a/src/it/sign-and-deploy-file-without-pom/setup.bsh
+++ b/src/it/sign-and-deploy-file-without-pom/setup.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+import org.codehaus.plexus.util.FileUtils
 
-import java.io.*;
-import org.codehaus.plexus.util.*;
-
-FileUtils.deleteDirectory( new File( basedir, "target" ) );
+FileUtils.deleteDirectory(new File(basedir, "target"))
diff --git a/src/it/sign-and-deploy-file-without-pom/verify.bsh b/src/it/sign-and-deploy-file-without-pom/verify.groovy
similarity index 67%
rename from src/it/sign-and-deploy-file-without-pom/verify.bsh
rename to src/it/sign-and-deploy-file-without-pom/verify.groovy
index 7019730..ac475df 100644
--- a/src/it/sign-and-deploy-file-without-pom/verify.bsh
+++ b/src/it/sign-and-deploy-file-without-pom/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,26 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+var artifactDir = new File(basedir, "target/repo/org/apache/maven/its/gpg/sadfwop/test/1.0")
 
-import java.io.*;
-
-File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadfwop/test/1.0" );
-
-String[] expectedFiles = {
+var expectedFiles = [
     "test-1.0.jar",
     "test-1.0.jar.asc",
     "test-1.0.pom",
-    "test-1.0.pom.asc",
-};
+    "test-1.0.pom.asc"
+]
 
-for ( String expectedFile : expectedFiles )
-{
-    File file = new File( artifactDir, expectedFile );
+for (String expectedFile : expectedFiles) {
+    var file = new File(artifactDir, expectedFile)
 
-    System.out.println( "Checking for existence of " + file );
+    println "Checking for existence of $file"
 
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
+    if (!file.isFile()) {
+        throw new Exception("Missing file $file")
     }
 }
diff --git a/src/it/sign-and-deploy-file-with-extras/setup.bsh b/src/it/sign-and-deploy-files/setup.groovy
similarity index 87%
rename from src/it/sign-and-deploy-file-with-extras/setup.bsh
rename to src/it/sign-and-deploy-files/setup.groovy
index 03bc9f0..b642e65 100644
--- a/src/it/sign-and-deploy-file-with-extras/setup.bsh
+++ b/src/it/sign-and-deploy-files/setup.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+import org.codehaus.plexus.util.FileUtils
 
-import java.io.*;
-import org.codehaus.plexus.util.*;
-
-FileUtils.deleteDirectory( new File( basedir, "target" ) );
+FileUtils.deleteDirectory(new File(basedir, "target"))
diff --git a/src/it/sign-and-deploy-files/verify.bsh b/src/it/sign-and-deploy-files/verify.groovy
similarity index 73%
rename from src/it/sign-and-deploy-files/verify.bsh
rename to src/it/sign-and-deploy-files/verify.groovy
index 38b8919..d680001 100644
--- a/src/it/sign-and-deploy-files/verify.bsh
+++ b/src/it/sign-and-deploy-files/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,12 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+var artifactDir = new File(basedir, "target/repo/org/apache/maven/its/gpg/sadfs/test/1.0")
 
-import java.io.*;
-
-File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadfs/test/1.0" );
-
-String[] expectedFiles = {
+var expectedFiles = [
     "test-1.0.jar",
     "test-1.0.jar.asc",
     "test-1.0-sources.jar",
@@ -36,17 +32,15 @@ String[] expectedFiles = {
     "test-1.0-src.tar.gz",
     "test-1.0-src.tar.gz.asc",
     "test-1.0.tar.gz",
-    "test-1.0.tar.gz.asc",
-};
+    "test-1.0.tar.gz.asc"
+]
 
-for ( String expectedFile : expectedFiles )
-{
-    File file = new File( artifactDir, expectedFile );
+for (String expectedFile : expectedFiles) {
+    var file = new File(artifactDir, expectedFile)
 
-    System.out.println( "Checking for existence of " + file );
+    println "Checking for existence of $file"
 
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
+    if (!file.isFile()) {
+        throw new Exception("Missing file $file")
     }
 }
diff --git a/src/it/sign-and-deploy-not-jar-packaging/setup.bsh b/src/it/sign-and-deploy-not-jar-packaging/setup.bsh
deleted file mode 100644
index 03bc9f0..0000000
--- a/src/it/sign-and-deploy-not-jar-packaging/setup.bsh
+++ /dev/null
@@ -1,24 +0,0 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.*;
-import org.codehaus.plexus.util.*;
-
-FileUtils.deleteDirectory( new File( basedir, "target" ) );
diff --git a/src/it/sign-and-deploy-file-with-pom/setup.bsh b/src/it/sign-and-deploy-not-jar-packaging/setup.groovy
similarity index 87%
copy from src/it/sign-and-deploy-file-with-pom/setup.bsh
copy to src/it/sign-and-deploy-not-jar-packaging/setup.groovy
index 03bc9f0..b642e65 100644
--- a/src/it/sign-and-deploy-file-with-pom/setup.bsh
+++ b/src/it/sign-and-deploy-not-jar-packaging/setup.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+import org.codehaus.plexus.util.FileUtils
 
-import java.io.*;
-import org.codehaus.plexus.util.*;
-
-FileUtils.deleteDirectory( new File( basedir, "target" ) );
+FileUtils.deleteDirectory(new File(basedir, "target"))
diff --git a/src/it/sign-and-deploy-file-with-pom/setup.bsh b/src/it/sign-and-deploy-not-jar-packaging/verify.groovy
similarity index 66%
rename from src/it/sign-and-deploy-file-with-pom/setup.bsh
rename to src/it/sign-and-deploy-not-jar-packaging/verify.groovy
index 03bc9f0..d086cb4 100644
--- a/src/it/sign-and-deploy-file-with-pom/setup.bsh
+++ b/src/it/sign-and-deploy-not-jar-packaging/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,8 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+var artifactDir = new File(basedir, "target/repo/org/apache/maven/its/gpg/sadnjp/test/1.0")
+
+var expectedFiles = [
+    "test-1.0-javadoc.jar",
+    "test-1.0-javadoc.jar.asc"
+]
+
+for (String expectedFile : expectedFiles) {
+    var file = new File(artifactDir, expectedFile)
 
-import java.io.*;
-import org.codehaus.plexus.util.*;
+    println "Checking for existence of $file"
 
-FileUtils.deleteDirectory( new File( basedir, "target" ) );
+    if (!file.isFile()) {
+        throw new Exception("Missing file $file")
+    }
+}
diff --git a/src/it/sign-release-with-excludes/verify.bsh b/src/it/sign-release-with-excludes/verify.bsh
deleted file mode 100644
index b464464..0000000
--- a/src/it/sign-release-with-excludes/verify.bsh
+++ /dev/null
@@ -1,58 +0,0 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.util.List;
-import org.codehaus.plexus.util.FileUtils;
-
-File artifactDir = new File( localRepositoryPath, "org/apache/maven/its/gpg/srwe/test/1.0" );
-
-String[] expectedFiles = {
-    "_remote.repositories",
-    "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 ( File file : artifactDir.listFiles() )
-{
-    String fileName = file.getName();
-    System.out.println( "Checking if file is expected: " + fileName );
-
-    boolean expected = false;
-    for ( String expectedFile : expectedFiles )
-    {
-        if ( expectedFile.equals( fileName ) )
-        {
-            expected = true;
-            break;
-        }
-    }
-
-    if ( !expected )
-    {
-        throw new Exception( "Unexpected file " + file );
-    }
-}
diff --git a/src/it/sign-and-deploy-file-with-extras/verify.bsh b/src/it/sign-release-with-excludes/verify.groovy
similarity index 62%
rename from src/it/sign-and-deploy-file-with-extras/verify.bsh
rename to src/it/sign-release-with-excludes/verify.groovy
index 1e1752b..a19f510 100644
--- a/src/it/sign-and-deploy-file-with-extras/verify.bsh
+++ b/src/it/sign-release-with-excludes/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,30 +16,31 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+var artifactDir = new File(localRepositoryPath, "org/apache/maven/its/gpg/srwe/test/1.0")
 
-import java.io.*;
-
-File artifactDir = new File( basedir, "target/repo/org/apache/maven/its/gpg/sadfwe/test/1.0" );
-
-String[] expectedFiles = {
+var expectedFiles = [
+    "_remote.repositories",
+    "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",
-    "test-1.0-javadoc.jar",
-    "test-1.0-javadoc.jar.asc",
-    "test-1.0.pom",
-    "test-1.0.pom.asc",
-};
+    "test-1.0-sources.jar.asc"
+]
 
-for ( String expectedFile : expectedFiles )
-{
-    File file = new File( artifactDir, expectedFile );
+for (File file : artifactDir.listFiles()) {
+    var fileName = file.getName()
+    println "Checking if file is expected: $file"
 
-    System.out.println( "Checking for existence of " + file );
+    var expected = false;
+    for (String expectedFile : expectedFiles) {
+        if (expectedFile == fileName) {
+            expected = true
+            break
+        }
+    }
 
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
+    if (!expected) {
+        throw new Exception("Unexpected file $file")
     }
 }
diff --git a/src/it/sign-release-without-passphrase/verify.bsh b/src/it/sign-release-without-passphrase/verify.groovy
similarity index 66%
rename from src/it/sign-release-without-passphrase/verify.bsh
rename to src/it/sign-release-without-passphrase/verify.groovy
index 8ff268c..eaeee90 100644
--- a/src/it/sign-release-without-passphrase/verify.bsh
+++ b/src/it/sign-release-without-passphrase/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -18,21 +17,19 @@
  * under the License.
  */
 
-import java.io.*;
-import org.codehaus.plexus.util.FileUtils;
 
-File buildLog = new File( basedir, "build.log" );
-String logContent = FileUtils.fileRead(buildLog);
+import org.codehaus.plexus.util.FileUtils
+
+var buildLog = new File(basedir, "build.log")
+var logContent = FileUtils.fileRead(buildLog)
 
 // assert that the Maven build properly failed and did not time out
-if ( !logContent.contains( "Total time: " ) || !logContent.contains( "Finished at: " ) )
-{
-	throw new Exception( "Maven build did not fail, but timed out" );
+if (!logContent.contains("Total time: ") || !logContent.contains("Finished at: ")) {
+    throw new Exception("Maven build did not fail, but timed out")
 }
 
 // assert that the Maven build failed, because pinentry is not allowed in non-interactive mode
-if ( !logContent.contains( "[GNUPG:] FAILURE sign 67108949" ) )
-{
-	throw new Exception( "Maven build did not fail in consequence of pinentry not being available to GPG" );
+if (!logContent.contains("[GNUPG:] FAILURE sign 67108949")) {
+    throw new Exception("Maven build did not fail in consequence of pinentry not being available to GPG")
 }
 
diff --git a/src/it/sign-release/verify.bsh b/src/it/sign-release/verify.bsh
deleted file mode 100644
index 495669e..0000000
--- a/src/it/sign-release/verify.bsh
+++ /dev/null
@@ -1,44 +0,0 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.*;
-
-File artifactDir = new File( localRepositoryPath, "org/apache/maven/its/gpg/sr/test/1.0" );
-
-String[] 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 );
-
-    System.out.println( "Checking for existence of " + file );
-
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
-    }
-}
diff --git a/src/it/alternative-secret-keyring/verify.bsh b/src/it/sign-release/verify.groovy
similarity index 69%
rename from src/it/alternative-secret-keyring/verify.bsh
rename to src/it/sign-release/verify.groovy
index 4cde67d..489b1b3 100644
--- a/src/it/alternative-secret-keyring/verify.bsh
+++ b/src/it/sign-release/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,26 +16,23 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+var artifactDir = new File(localRepositoryPath, "org/apache/maven/its/gpg/sr/test/1.0")
 
-import java.io.*;
-
-File artifactDir = new File( localRepositoryPath, "org/apache/maven/its/gpg/ask/test/1.0" );
-
-String[] expectedFiles = {
+var 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 );
+for (String expectedFile : expectedFiles) {
+    var file = new File(artifactDir, expectedFile)
 
-    System.out.println( "Checking for existence of " + file );
+    println "Checking for existence of $file"
 
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
+    if (!file.isFile()) {
+        throw new Exception("Missing file $file")
     }
 }
diff --git a/src/it/sign-with-passphase-from-maven-settings/verify.bsh b/src/it/sign-with-passphase-from-maven-settings/verify.bsh
deleted file mode 100644
index ee9dddb..0000000
--- a/src/it/sign-with-passphase-from-maven-settings/verify.bsh
+++ /dev/null
@@ -1,42 +0,0 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.*;
-
-File artifactDir = new File( localRepositoryPath, "org/apache/maven/its/gpg/nma/test/1.0" );
-
-String[] expectedFiles = {
-    "test-1.0.pom",
-    "test-1.0.pom.asc",
-    "test-1.0-jdk15.jar",
-    "test-1.0-jdk15.jar.asc",
-};
-
-for ( String expectedFile : expectedFiles )
-{
-    File file = new File( artifactDir, expectedFile );
-
-    System.out.println( "Checking for existence of " + file );
-
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
-    }
-}
diff --git a/src/it/no-main-artifact/verify.bsh b/src/it/sign-with-passphase-from-maven-settings/verify.groovy
similarity index 67%
rename from src/it/no-main-artifact/verify.bsh
rename to src/it/sign-with-passphase-from-maven-settings/verify.groovy
index efa0463..49b5553 100644
--- a/src/it/no-main-artifact/verify.bsh
+++ b/src/it/sign-with-passphase-from-maven-settings/verify.groovy
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -17,26 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+var artifactDir = new File(localRepositoryPath, "org/apache/maven/its/gpg/nma/test/1.0")
 
-import java.io.*;
-
-File artifactDir = new File( localRepositoryPath, "org/apache/maven/its/gpg/nma/test/1.0" );
-
-String[] expectedFiles = {
+var expectedFiles = [
     "test-1.0.pom",
     "test-1.0.pom.asc",
     "test-1.0-jdk15.jar",
-    "test-1.0-jdk15.jar.asc",
-};
+    "test-1.0-jdk15.jar.asc"
+]
 
-for ( String expectedFile : expectedFiles )
-{
-    File file = new File( artifactDir, expectedFile );
+for (String expectedFile : expectedFiles) {
+    var file = new File(artifactDir, expectedFile)
 
-    System.out.println( "Checking for existence of " + file );
+    println "Checking for existence of $file"
 
-    if ( !file.isFile() )
-    {
-        throw new Exception( "Missing file " + file );
+    if (!file.isFile()) {
+        throw new Exception("Missing file $file")
     }
 }