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 2026/09/20 13:17:54 UTC
(maven-war-plugin) 02/02: Port the IT scripts from BeanShell to Groovy
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-war-plugin.git
commit a2ed77652bbce489434a8f0225e83b1c027f943f
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun Sep 20 13:56:51 2026 +0200
Port the IT scripts from BeanShell to Groovy
BeanShell is being retired across Maven (apache/maven#13207); the scripts keep the same checks.
---
src/it/MWAR-133/verify.groovy | 4 ++--
src/it/MWAR-139/verify.groovy | 4 ++--
src/it/MWAR-143/verify.groovy | 4 ++--
src/it/MWAR-240/verify.groovy | 4 ++--
src/it/MWAR-450/verify.groovy | 8 ++++----
src/it/archiveClasses/verify.groovy | 12 ++++++------
src/it/default/verify.groovy | 12 ++++++------
src/it/web-resources-filtering-delimiter/verify.groovy | 2 +-
src/it/web-resources-filtering/verify.groovy | 4 ++--
9 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/it/MWAR-133/verify.groovy b/src/it/MWAR-133/verify.groovy
index 8898963..5fa3b69 100644
--- a/src/it/MWAR-133/verify.groovy
+++ b/src/it/MWAR-133/verify.groovy
@@ -49,10 +49,10 @@ try
String paramContent = FileUtils.fileRead( filtered );
- int indexOf = paramContent.indexOf( "app.version=${node.version}" );
+ int indexOf = paramContent.indexOf( 'app.version=${node.version}' );
if ( indexOf < 0 )
{
- System.err.println( "filtered.properties was not filtered with the value of ${node.version}" );
+ System.err.println( 'filtered.properties was not filtered with the value of ${node.version}' );
return false;
}
diff --git a/src/it/MWAR-139/verify.groovy b/src/it/MWAR-139/verify.groovy
index 390c0be..1e8a69c 100644
--- a/src/it/MWAR-139/verify.groovy
+++ b/src/it/MWAR-139/verify.groovy
@@ -55,10 +55,10 @@ try
return false;
}
- indexOf = paramContent.indexOf( "<text2>start-${}-end</text2>" );
+ indexOf = paramContent.indexOf( '<text2>start-${}-end</text2>' );
if ( indexOf < 0 )
{
- System.err.println( "filterme.xml does not contains <text2>start-${}-end</text2>" );
+ System.err.println( 'filterme.xml does not contains <text2>start-${}-end</text2>' );
return false;
}
diff --git a/src/it/MWAR-143/verify.groovy b/src/it/MWAR-143/verify.groovy
index 45ed59e..7ba365a 100644
--- a/src/it/MWAR-143/verify.groovy
+++ b/src/it/MWAR-143/verify.groovy
@@ -23,7 +23,7 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-filesAreIdentical( File expected, File current )
+boolean filesAreIdentical( File expected, File current )
throws IOException
{
if ( expected.length() != current.length() )
@@ -105,7 +105,7 @@ try
targetImg = new File( basedir, "war-filter-overlay/target/custom-manifest-1.0-SNAPSHOT/duke-beer.jpg" );
- boolean identical = filesAreIdentical( originalImg, targetImg );
+ identical = filesAreIdentical( originalImg, targetImg );
if ( !identical )
{
diff --git a/src/it/MWAR-240/verify.groovy b/src/it/MWAR-240/verify.groovy
index fec4b9d..d34df55 100644
--- a/src/it/MWAR-240/verify.groovy
+++ b/src/it/MWAR-240/verify.groovy
@@ -35,9 +35,9 @@ try
JarFile jar = new JarFile( jarFile );
- String[] includedEntries = {
+ String[] includedEntries = [
"org/apache/maven/plugin/war/it/Dummy.class",
- };
+ ];
for ( String included : includedEntries )
{
System.out.println( "Checking for existence of " + included );
diff --git a/src/it/MWAR-450/verify.groovy b/src/it/MWAR-450/verify.groovy
index 3e1b808..4e53c2b 100644
--- a/src/it/MWAR-450/verify.groovy
+++ b/src/it/MWAR-450/verify.groovy
@@ -58,7 +58,7 @@ try
return false;
}
Properties properties = new Properties();
- FileInputStream fis = new FileInputStream( myProperties );
+ fis = new FileInputStream( myProperties );
properties.load( fis );
fis.close();
String property = properties.get( "my.property" );
@@ -75,10 +75,10 @@ try
System.err.println( "myfile.txt is missing or is a directory." );
return false;
}
- FileInputStream fis = new FileInputStream ( myfile );
- String paramContent = IOUtil.toString ( fis, "UTF-8" );
+ fis = new FileInputStream ( myfile );
+ paramContent = IOUtil.toString ( fis, "UTF-8" );
System.out.println( "content='" + paramContent + "'" );
- int indexOf = paramContent.indexOf( "Characters that should be encoded in UTF-8: åäö" );
+ indexOf = paramContent.indexOf( "Characters that should be encoded in UTF-8: åäö" );
if ( indexOf < 0 )
{
System.err.println( "Non-ascii characters changed encoding during filtering" );
diff --git a/src/it/archiveClasses/verify.groovy b/src/it/archiveClasses/verify.groovy
index 9b3da75..a9e70aa 100644
--- a/src/it/archiveClasses/verify.groovy
+++ b/src/it/archiveClasses/verify.groovy
@@ -32,11 +32,11 @@ try
return false;
}
- String[] expectedPaths = {
+ String[] expectedPaths = [
"index.html",
"WEB-INF/lib/commons-logging-1.0.3.jar",
"WEB-INF/lib/maven-it-mwar-45-1.0.jar",
- };
+ ];
for ( String path : expectedPaths )
{
File file = new File( explodedDir, path );
@@ -48,10 +48,10 @@ try
}
}
- String[] unexpectedPaths = {
+ String[] unexpectedPaths = [
"WEB-INF/classes/org/apache/maven/it0016/Person.class",
"WEB-INF/lib/servlet-api-2.4.jar",
- };
+ ];
for ( String path : unexpectedPaths )
{
File file = new File( explodedDir, path );
@@ -73,11 +73,11 @@ try
JarFile war = new JarFile( warFile );
- String[] includedEntries = {
+ String[] includedEntries = [
"index.html",
"WEB-INF/lib/maven-it-mwar-45-1.0.jar",
"WEB-INF/lib/commons-logging-1.0.3.jar",
- };
+ ];
for ( String included : includedEntries )
{
System.out.println( "Checking for existence of " + included );
diff --git a/src/it/default/verify.groovy b/src/it/default/verify.groovy
index af15a81..22edc06 100644
--- a/src/it/default/verify.groovy
+++ b/src/it/default/verify.groovy
@@ -32,11 +32,11 @@ try
return false;
}
- String[] expectedPaths = {
+ String[] expectedPaths = [
"index.html",
"WEB-INF/classes/org/apache/maven/it0016/Person.class",
"WEB-INF/lib/commons-logging-1.0.3.jar",
- };
+ ];
for ( String path : expectedPaths )
{
File file = new File( explodedDir, path );
@@ -48,9 +48,9 @@ try
}
}
- String[] unexpectedPaths = {
+ String[] unexpectedPaths = [
"WEB-INF/lib/servlet-api-2.4.jar",
- };
+ ];
for ( String path : unexpectedPaths )
{
File file = new File( explodedDir, path );
@@ -72,10 +72,10 @@ try
JarFile war = new JarFile( warFile );
- String[] includedEntries = {
+ String[] includedEntries = [
"WEB-INF/classes/org/apache/maven/it0016/Person.class",
"WEB-INF/lib/commons-logging-1.0.3.jar",
- };
+ ];
for ( String included : includedEntries )
{
System.out.println( "Checking for existence of " + included );
diff --git a/src/it/web-resources-filtering-delimiter/verify.groovy b/src/it/web-resources-filtering-delimiter/verify.groovy
index dd86ecd..44ea22b 100644
--- a/src/it/web-resources-filtering-delimiter/verify.groovy
+++ b/src/it/web-resources-filtering-delimiter/verify.groovy
@@ -87,7 +87,7 @@ try
}
Properties properties = new Properties();
- FileInputStream fis = new FileInputStream( myProperties );
+ fis = new FileInputStream( myProperties );
properties.load( fis );
fis.close();
diff --git a/src/it/web-resources-filtering/verify.groovy b/src/it/web-resources-filtering/verify.groovy
index 6ea7d17..df04684 100644
--- a/src/it/web-resources-filtering/verify.groovy
+++ b/src/it/web-resources-filtering/verify.groovy
@@ -70,7 +70,7 @@ try
return false;
}
- indexOf = paramContent.indexOf( "<Set name=\"password\">${jdbc.password}</Set>" );
+ indexOf = paramContent.indexOf( '<Set name="password">${jdbc.password}</Set>' );
if ( indexOf < 0 )
{
System.err.println( "jdbc.password has been filtered" );
@@ -94,7 +94,7 @@ try
}
Properties properties = new Properties();
- FileInputStream fis = new FileInputStream( myProperties );
+ fis = new FileInputStream( myProperties );
properties.load( fis );
fis.close();