This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git
commit b48d4ecbcc93ba94d351601431e6bf0dd2df69d4 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Wed Nov 25 23:01:21 2026 +0000 Modernize Groovy IT scripts See https://github.com/apache/maven-invoker-plugin/issues/811. --- src/it/MDEPLOY-213/verify.groovy | 5 ----- src/it/no-main-artifact-snapshot/setup.groovy | 11 ++--------- src/it/no-main-artifact-snapshot/verify.groovy | 25 ++++--------------------- 3 files changed, 6 insertions(+), 35 deletions(-) diff --git a/src/it/MDEPLOY-213/verify.groovy b/src/it/MDEPLOY-213/verify.groovy index d7c7223..74a249a 100644 --- a/src/it/MDEPLOY-213/verify.groovy +++ b/src/it/MDEPLOY-213/verify.groovy @@ -17,9 +17,6 @@ * under the License. */ -import java.io.*; -import java.util.*; - String[] paths = [ "org/apache/maven/its/mdeploy-213/test/1.0/test-1.0.pom", @@ -38,5 +35,3 @@ for ( String path : paths ) throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); } } - -return true; diff --git a/src/it/no-main-artifact-snapshot/setup.groovy b/src/it/no-main-artifact-snapshot/setup.groovy index 69fe703..10e7940 100644 --- a/src/it/no-main-artifact-snapshot/setup.groovy +++ b/src/it/no-main-artifact-snapshot/setup.groovy @@ -17,17 +17,10 @@ * under the License. */ -import java.io.*; -import java.util.*; - -import org.codehaus.plexus.util.*; - File file = new File( localRepositoryPath, "org/apache/maven/its/deploy/nmas" ); System.out.println( "Deleting " + file ); -FileUtils.deleteDirectory( file ); +assert file.deleteDir(); file = new File( basedir, "target/repo" ); System.out.println( "Deleting " + file ); -FileUtils.deleteDirectory( file ); - -return true; +assert file.deleteDir(); diff --git a/src/it/no-main-artifact-snapshot/verify.groovy b/src/it/no-main-artifact-snapshot/verify.groovy index 954cdde..f687bf1 100644 --- a/src/it/no-main-artifact-snapshot/verify.groovy +++ b/src/it/no-main-artifact-snapshot/verify.groovy @@ -17,17 +17,11 @@ * under the License. */ -import java.io.*; -import java.util.*; - File dir = new File( new File( basedir, "target/repo" ), "org/apache/maven/its/deploy/nmas/test/1.0-SNAPSHOT" ); String[] files = dir.list(); -if ( files == null ) -{ - throw new FileNotFoundException( "Missing directory: " + dir ); -} +assert files != null : "Missing directory: " + dir String pom = null, jar = null; @@ -43,19 +37,8 @@ for ( String file : files ) } } -if ( pom == null ) -{ - throw new FileNotFoundException( "Missing timestamped POM" ); -} - -if ( jar == null ) -{ - throw new FileNotFoundException( "Missing timestamped JAR" ); -} +assert pom != null : "Missing timestamped POM" -if ( !jar.equals( pom ) ) -{ - throw new IllegalStateException( "Timestamp mismatch " + jar + " vs " + pom ); -} +assert jar != null : "Missing timestamped JAR" -return true; +assert jar.equals( pom ) : "Timestamp mismatch " + jar + " vs " + pom
