This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch maven-source-plugin-4.x
in repository https://gitbox.apache.org/repos/asf/maven-source-plugin.git
The following commit(s) were added to refs/heads/maven-source-plugin-4.x by
this push:
new 32613d8 Format Groovy IT scripts
32613d8 is described below
commit 32613d8390fcd96f7701ecd4881bf9a1bcd7b8c3
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Wed Nov 25 20:59:10 2026 +0000
Format Groovy IT scripts
Formatting only: the CONVERSION-phase AST of every file is unchanged. See
https://github.com/apache/maven-invoker-plugin/issues/811.
---
src/it/MSOURCES-121/verify.groovy | 2 +-
src/it/MSOURCES-140/verify.groovy | 2 +-
src/it/MSOURCES-62/verify.groovy | 57 +++++-----
src/it/MSOURCES-95/verify.groovy | 2 +-
src/it/jar-attached/verify.groovy | 40 ++++---
src/it/jar-classifier/verify.groovy | 64 +++++------
src/it/jar-includes-excludes/verify.groovy | 118 ++++++++-------------
src/it/jar-no-fork/verify.groovy | 68 +++++-------
src/it/jar-with-archive-config/verify.groovy | 81 ++++++--------
src/it/jar-without-descriptor-config/verify.groovy | 69 +++++-------
src/it/jar/verify.groovy | 64 +++++------
src/it/manifest-content/verify.groovy | 41 ++++---
src/it/project-without-sources/verify.groovy | 43 ++++----
src/it/reproducible/verify.groovy | 83 +++++++--------
src/it/test-jar-classifier/verify.groovy | 69 +++++-------
src/it/test-jar-generated/verify.groovy | 64 +++++------
src/it/test-jar-no-fork/verify.groovy | 68 +++++-------
src/it/test-jar/verify.groovy | 69 +++++-------
.../verify.groovy | 2 +-
.../verify.groovy | 2 +-
src/it/verify-parameter-goal-jar/verify.groovy | 2 +-
.../verify.groovy | 2 +-
.../verify-parameter-goal-test-jar/verify.groovy | 2 +-
23 files changed, 422 insertions(+), 592 deletions(-)
diff --git a/src/it/MSOURCES-121/verify.groovy
b/src/it/MSOURCES-121/verify.groovy
index 308a3c7..b659eec 100644
--- a/src/it/MSOURCES-121/verify.groovy
+++ b/src/it/MSOURCES-121/verify.groovy
@@ -17,7 +17,7 @@
* under the License.
*/
-File buildLog = new File( basedir, 'build.log' )
+File buildLog = new File(basedir, 'build.log')
var fs = File.separatorChar == '\\' ? "\\\\" : "/"
assert buildLog.text =~ /\[ERROR\] Artifact
org.apache.maven.its.sources:jar-no-fork:jar:sources:1.0-SNAPSHOT already
attached to a file target${fs}jar-no-fork-1.0-SNAPSHOT-sources.jar: attach to
target${fs}jar-no-fork-1.0-SNAPSHOT-secondary-sources.jar should be done with
another classifier/
diff --git a/src/it/MSOURCES-140/verify.groovy
b/src/it/MSOURCES-140/verify.groovy
index 8bcda12..8a43d35 100644
--- a/src/it/MSOURCES-140/verify.groovy
+++ b/src/it/MSOURCES-140/verify.groovy
@@ -18,6 +18,6 @@
*/
-File buildLog = new File( basedir, 'build.log' )
+File buildLog = new File(basedir, 'build.log')
assert buildLog.text.contains("[INFO] Artifact
org.apache.maven.its.sources:jar-no-fork:jar:sources:1.0-SNAPSHOT already
attached to target" + File.separator + "jar-no-fork-1.0-SNAPSHOT-sources.jar:
ignoring same re-attach (same artifact, same file)")
diff --git a/src/it/MSOURCES-62/verify.groovy b/src/it/MSOURCES-62/verify.groovy
index 77259b6..292a327 100644
--- a/src/it/MSOURCES-62/verify.groovy
+++ b/src/it/MSOURCES-62/verify.groovy
@@ -18,44 +18,39 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-
-boolean result = true;
-
-try
-{
- File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
- System.err.println( "target file is missing or not a directory." );
- return false;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+
+boolean result = true
+
+try {
+ File target = new File(basedir, "target")
+ if (!target.exists() || !target.isDirectory()) {
+ System.err.println("target file is missing or not a directory.")
+ return false
}
- File artifact = new File( target, "MSOURCES-62-1.0-SNAPSHOT-sources.jar" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
- System.err.println( "artifact file is missing or a directory." );
- return false;
+ File artifact = new File(target, "MSOURCES-62-1.0-SNAPSHOT-sources.jar")
+ if (!artifact.exists() || artifact.isDirectory()) {
+ System.err.println("artifact file is missing or a directory.")
+ return false
}
- JarFile jar = new JarFile( artifact );
+ JarFile jar = new JarFile(artifact)
- Attributes manifest = jar.getManifest().getMainAttributes();
+ Attributes manifest = jar.getManifest().getMainAttributes()
- String val = manifest.getValue( new Attributes.Name( "An-Entry" ) );
- System.out.println("An-Entry:'"+val+"'");
- if ( !"Some Value".equals( val) )
- {
- System.err.println( "An-Entry manifest entry" + " not equals Some
Value" );
- return false;
+ String val = manifest.getValue(new Attributes.Name("An-Entry"))
+ System.out.println("An-Entry:'"+val+"'")
+ if (!"Some Value".equals(val)) {
+ System.err.println("An-Entry manifest entry" + " not equals Some
Value")
+ return false
}
}
-catch( Throwable e )
-{
- e.printStackTrace();
- result = false;
+catch(Throwable e) {
+ e.printStackTrace()
+ result = false
}
-return result;
+return result
diff --git a/src/it/MSOURCES-95/verify.groovy b/src/it/MSOURCES-95/verify.groovy
index bf8d6e9..753df64 100644
--- a/src/it/MSOURCES-95/verify.groovy
+++ b/src/it/MSOURCES-95/verify.groovy
@@ -17,7 +17,7 @@
* under the License.
*/
-File buildLog = new File( basedir, 'build.log' )
+File buildLog = new File(basedir, 'build.log')
String sourcesJarFileName = 'empty-source-directory-1.0-SNAPSHOT-sources.jar'
String testSourcesJarFileName =
"empty-source-directory-1.0-SNAPSHOT-test-sources.jar"
diff --git a/src/it/jar-attached/verify.groovy
b/src/it/jar-attached/verify.groovy
index 1b3a09b..0c6a905 100644
--- a/src/it/jar-attached/verify.groovy
+++ b/src/it/jar-attached/verify.groovy
@@ -17,32 +17,28 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/jar-attached-1.0-SNAPSHOT-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/jar-attached-1.0-SNAPSHOT-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- File attachedFile = new File( localRepositoryPath,
"org/apache/maven/its/ejb/jar-attached/1.0-SNAPSHOT/jar-attached-1.0-SNAPSHOT-sources.jar"
);
- System.out.println( "Checking for existence of " + attachedFile );
- if ( !attachedFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+ File attachedFile = new File(localRepositoryPath,
"org/apache/maven/its/ejb/jar-attached/1.0-SNAPSHOT/jar-attached-1.0-SNAPSHOT-sources.jar")
+ System.out.println("Checking for existence of " + attachedFile)
+ if (!attachedFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/jar-classifier/verify.groovy
b/src/it/jar-classifier/verify.groovy
index a185814..5dfc097 100644
--- a/src/it/jar-classifier/verify.groovy
+++ b/src/it/jar-classifier/verify.groovy
@@ -17,57 +17,47 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/jar-classifier-1.0-SNAPSHOT-foo.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/jar-classifier-1.0-SNAPSHOT-foo.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
String[] includedEntries = [
"META-INF/MANIFEST.MF",
"MyClass.java",
"main.properties",
"generated.properties",
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ ]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyTest.java",
- "test.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyTest.java", "test.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/jar-includes-excludes/verify.groovy
b/src/it/jar-includes-excludes/verify.groovy
index fe3b743..d1a29c3 100644
--- a/src/it/jar-includes-excludes/verify.groovy
+++ b/src/it/jar-includes-excludes/verify.groovy
@@ -17,98 +17,70 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/jar-includes-excludes-1.0-SNAPSHOT-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/jar-includes-excludes-1.0-SNAPSHOT-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
- String[] includedEntries = [
- "META-INF/MANIFEST.MF",
- "MyClass2.java"
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] includedEntries = ["META-INF/MANIFEST.MF", "MyClass2.java"]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyTest.java",
- "test.properties",
- "MyClass.java",
- "main.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyTest.java", "test.properties",
"MyClass.java", "main.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- jarFile = new File( basedir,
"target/jar-includes-excludes-1.0-SNAPSHOT-test-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+ jarFile = new File(basedir,
"target/jar-includes-excludes-1.0-SNAPSHOT-test-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- jar = new JarFile( jarFile );
+ jar = new JarFile(jarFile)
- includedEntries = [
- "META-INF/MANIFEST.MF",
- "MyTest.java",
- "test.properties",
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ includedEntries = ["META-INF/MANIFEST.MF", "MyTest.java",
"test.properties",]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- excludedEntries = [
- "MyTest2.java",
- "MyClass.java"
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ excludedEntries = ["MyTest2.java", "MyClass.java"]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
-
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/jar-no-fork/verify.groovy b/src/it/jar-no-fork/verify.groovy
index d108361..3768bf7 100644
--- a/src/it/jar-no-fork/verify.groovy
+++ b/src/it/jar-no-fork/verify.groovy
@@ -17,56 +17,42 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/jar-no-fork-1.0-SNAPSHOT-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/jar-no-fork-1.0-SNAPSHOT-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
- String[] includedEntries = [
- "META-INF/MANIFEST.MF",
- "MyClass.java",
- "main.properties",
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] includedEntries = ["META-INF/MANIFEST.MF", "MyClass.java",
"main.properties",]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyTest.java",
- "test.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyTest.java", "test.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/jar-with-archive-config/verify.groovy
b/src/it/jar-with-archive-config/verify.groovy
index b8e5798..4e98c54 100644
--- a/src/it/jar-with-archive-config/verify.groovy
+++ b/src/it/jar-with-archive-config/verify.groovy
@@ -17,65 +17,50 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/jar-with-archive-config-1.0-SNAPSHOT-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/jar-with-archive-config-1.0-SNAPSHOT-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
- String[] includedEntries = [
- "META-INF/MANIFEST.MF",
- "MyClass.java",
- "main.properties",
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] includedEntries = ["META-INF/MANIFEST.MF", "MyClass.java",
"main.properties",]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyTest.java",
- "test.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyTest.java", "test.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- System.out.println( "Checking manifest for attribute:
Implementation-Version " );
- Map manifestAttributes = jar.getManifest().getMainAttributes();
- String implVersion = manifestAttributes.getValue( "Implementation-Version"
);
- if ( implVersion == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ System.out.println("Checking manifest for attribute:
Implementation-Version ")
+ Map manifestAttributes = jar.getManifest().getMainAttributes()
+ String implVersion = manifestAttributes.getValue("Implementation-Version")
+ if (implVersion == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/jar-without-descriptor-config/verify.groovy
b/src/it/jar-without-descriptor-config/verify.groovy
index aef9da2..ad7c76c 100644
--- a/src/it/jar-without-descriptor-config/verify.groovy
+++ b/src/it/jar-without-descriptor-config/verify.groovy
@@ -17,57 +17,42 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/jar-without-descriptor-config-1.0-SNAPSHOT-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/jar-without-descriptor-config-1.0-SNAPSHOT-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
- String[] includedEntries = [
- "META-INF/MANIFEST.MF",
- "MyClass.java",
- "main.properties",
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] includedEntries = ["META-INF/MANIFEST.MF", "MyClass.java",
"main.properties",]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyTest.java",
- "test.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyTest.java", "test.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
-
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/jar/verify.groovy b/src/it/jar/verify.groovy
index cf1d9d2..619c6bf 100644
--- a/src/it/jar/verify.groovy
+++ b/src/it/jar/verify.groovy
@@ -17,57 +17,47 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir, "target/jar-1.0-SNAPSHOT-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir, "target/jar-1.0-SNAPSHOT-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
String[] includedEntries = [
"META-INF/MANIFEST.MF",
"MyClass.java",
"main.properties",
"generated.properties",
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ ]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyTest.java",
- "test.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyTest.java", "test.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/manifest-content/verify.groovy
b/src/it/manifest-content/verify.groovy
index f6b340f..68a7f46 100644
--- a/src/it/manifest-content/verify.groovy
+++ b/src/it/manifest-content/verify.groovy
@@ -18,35 +18,30 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
-boolean result = true;
+boolean result = true
-try
-{
- File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
- System.err.println( "target file is missing or not a directory." );
- return false;
+try {
+ File target = new File(basedir, "target")
+ if (!target.exists() || !target.isDirectory()) {
+ System.err.println("target file is missing or not a directory.")
+ return false
}
- File artifact = new File( target,
"manifest-content-1.0-SNAPSHOT-sources.jar" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
- System.err.println( "artifact file is missing or a directory." );
- return false;
+ File artifact = new File(target,
"manifest-content-1.0-SNAPSHOT-sources.jar")
+ if (!artifact.exists() || artifact.isDirectory()) {
+ System.err.println("artifact file is missing or a directory.")
+ return false
}
- JarFile jar = new JarFile( artifact );
-
+ JarFile jar = new JarFile(artifact)
}
-catch( Throwable e )
-{
- e.printStackTrace();
- result = false;
+catch(Throwable e) {
+ e.printStackTrace()
+ result = false
}
-return result;
+return result
diff --git a/src/it/project-without-sources/verify.groovy
b/src/it/project-without-sources/verify.groovy
index 5f16c74..b997926 100755
--- a/src/it/project-without-sources/verify.groovy
+++ b/src/it/project-without-sources/verify.groovy
@@ -17,34 +17,29 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/project-without-sources-1.0-SNAPSHOT-sources.jar" );
- System.out.println( "Checking for non-existence of " + jarFile );
- if ( jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/project-without-sources-1.0-SNAPSHOT-sources.jar")
+ System.out.println("Checking for non-existence of " + jarFile)
+ if (jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- File testJarFile = new File( basedir,
"target/project-without-sources-1.0-SNAPSHOT-test-sources.jar" );
- System.out.println( "Checking for non-existence of " + testJarFile );
- if ( testJarFile.exists() )
- {
- System.out.println( "FAILURE!" );
- return false;
+ File testJarFile = new File(basedir,
"target/project-without-sources-1.0-SNAPSHOT-test-sources.jar")
+ System.out.println("Checking for non-existence of " + testJarFile)
+ if (testJarFile.exists()) {
+ System.out.println("FAILURE!")
+ return false
}
-
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/reproducible/verify.groovy
b/src/it/reproducible/verify.groovy
index 8c11d18..27e98b3 100644
--- a/src/it/reproducible/verify.groovy
+++ b/src/it/reproducible/verify.groovy
@@ -18,69 +18,64 @@
* under the License.
*/
-import java.nio.file.attribute.FileTime;
-import java.time.Instant;
-import org.apache.commons.compress.archivers.zip.*;
+import java.nio.file.attribute.FileTime
+import java.time.Instant
+import org.apache.commons.compress.archivers.zip.*
-File deployDir = new File( basedir,
'target/repo/org/apache/maven/its/reproducible/1.0' )
+File deployDir = new File(basedir,
'target/repo/org/apache/maven/its/reproducible/1.0')
assert deployDir.exists()
-File sha1File = new File( deployDir, 'reproducible-1.0-sources.jar.sha1' )
+File sha1File = new File(deployDir, 'reproducible-1.0-sources.jar.sha1')
assert deployDir.exists()
String sha1 = sha1File.text
StringBuffer r = new StringBuffer()
-r.append( "reproducible-1.0-sources.jar sha1 = $sha1\n\n" )
-
-File jarFile = new File( deployDir, 'reproducible-1.0-sources.jar' )
-ZipFile zipFile = new ZipFile( jarFile );
-
-r.append( 'encoding: ' + zipFile.getEncoding() + '\n' )
-r.append( 'timezone offset (minutes): ' + new Date().getTimezoneOffset() +
'\n' )
-r.append( 'M size (cmp) crc java time date time zip
time mode name -comment; extra\n' )
-
-String describeExtra( ZipExtraField[] extras )
-{
- StringBuffer b = new StringBuffer()
- b.append( extras.length )
- for( ZipExtraField extra : extras )
- {
- b.append( sprintf( " [%s]%x", extra.getHeaderId().toString(),
getLocalFileDataData() ) )
- }
- return b.toString()
+r.append("reproducible-1.0-sources.jar sha1 = $sha1\n\n")
+
+File jarFile = new File(deployDir, 'reproducible-1.0-sources.jar')
+ZipFile zipFile = new ZipFile(jarFile)
+
+r.append('encoding: ' + zipFile.getEncoding() + '\n')
+r.append('timezone offset (minutes): ' + new Date().getTimezoneOffset() + '\n')
+r.append('M size (cmp) crc java time date time zip
time mode name -comment; extra\n')
+
+String describeExtra(ZipExtraField[] extras) {
+ StringBuffer b = new StringBuffer()
+ b.append(extras.length)
+ for(ZipExtraField extra : extras) {
+ b.append(sprintf(" [%s]%x", extra.getHeaderId().toString(),
getLocalFileDataData()))
+ }
+ return b.toString()
}
-long javaToDosTime( Date d )
-{
- int year = d.getYear() + 1900;
- if ( year < 1980 )
- {
- return ZipEntry.DOSTIME_BEFORE_1980;
+long javaToDosTime(Date d) {
+ int year = d.getYear() + 1900
+ if (year < 1980) {
+ return ZipEntry.DOSTIME_BEFORE_1980
}
- return ( year - 1980 ) << 25 | ( d.getMonth() + 1 ) << 21 |
- d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
- d.getSeconds() >> 1;
+ return (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
+ d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
+ d.getSeconds() >> 1
}
// Normalize to UTC
-long millis = Instant.parse( "2019-08-21T18:28:52Z" ).toEpochMilli();
-Calendar cal = Calendar.getInstance();
-cal.setTimeInMillis( millis );
-millis = millis - ( cal.get( Calendar.ZONE_OFFSET ) + cal.get(
Calendar.DST_OFFSET ) );
-FileTime timestamp = FileTime.fromMillis( millis );
-
-for ( ZipArchiveEntry zae : zipFile.getEntries() )
-{
- r.append( sprintf( "%d %4d (%3d) %8x %d %<tF %<tT %<tz %d %6o %s %s;
%s\n", zae.getMethod(), zae.getSize(), zae.getCompressedSize(), zae.getCrc(),
zae.getTime(), javaToDosTime( zae.getLastModifiedDate() ), zae.getUnixMode(),
zae.getName(), ( zae.getComment() == null ) ? '-' : zae.getComment(),
describeExtra( zae.getExtraFields() ) ) )
- assert timestamp.equals( zae.getLastModifiedTime() );
+long millis = Instant.parse("2019-08-21T18:28:52Z").toEpochMilli()
+Calendar cal = Calendar.getInstance()
+cal.setTimeInMillis(millis)
+millis = millis - (cal.get(Calendar.ZONE_OFFSET) +
cal.get(Calendar.DST_OFFSET))
+FileTime timestamp = FileTime.fromMillis(millis)
+
+for (ZipArchiveEntry zae : zipFile.getEntries()) {
+ r.append(sprintf("%d %4d (%3d) %8x %d %<tF %<tT %<tz %d %6o %s %s; %s\n",
zae.getMethod(), zae.getSize(), zae.getCompressedSize(), zae.getCrc(),
zae.getTime(), javaToDosTime(zae.getLastModifiedDate()), zae.getUnixMode(),
zae.getName(), (zae.getComment() == null) ? '-' : zae.getComment(),
describeExtra(zae.getExtraFields())))
+ assert timestamp.equals(zae.getLastModifiedTime())
}
-zipFile.close();
+zipFile.close()
String buf = r.toString()
println buf
// on Windows executable bit is not set
-assert buf.startsWith( "reproducible-1.0-sources.jar sha1 =
f159379802c1f0dc1083af21352286b09d364519" ) || buf.startsWith(
"reproducible-1.0-sources.jar sha1 = e14cb3b37b6d82db1728886d1959ad0cd79708d8" )
+assert buf.startsWith("reproducible-1.0-sources.jar sha1 =
f159379802c1f0dc1083af21352286b09d364519") ||
buf.startsWith("reproducible-1.0-sources.jar sha1 =
e14cb3b37b6d82db1728886d1959ad0cd79708d8")
diff --git a/src/it/test-jar-classifier/verify.groovy
b/src/it/test-jar-classifier/verify.groovy
index cbfb3d6..8685f84 100644
--- a/src/it/test-jar-classifier/verify.groovy
+++ b/src/it/test-jar-classifier/verify.groovy
@@ -17,57 +17,42 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/test-jar-classifier-1.0-SNAPSHOT-bar.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/test-jar-classifier-1.0-SNAPSHOT-bar.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
- String[] includedEntries = [
- "META-INF/MANIFEST.MF",
- "MyTest.java",
- "test.properties",
- "generated.properties",
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] includedEntries = ["META-INF/MANIFEST.MF", "MyTest.java",
"test.properties", "generated.properties",]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyClass.java",
- "main.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyClass.java", "main.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/test-jar-generated/verify.groovy
b/src/it/test-jar-generated/verify.groovy
index 9e36840..2896204 100644
--- a/src/it/test-jar-generated/verify.groovy
+++ b/src/it/test-jar-generated/verify.groovy
@@ -17,22 +17,20 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/test-jar-generated-1.0-SNAPSHOT-test-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/test-jar-generated-1.0-SNAPSHOT-test-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
String[] includedEntries = [
"META-INF/MANIFEST.MF",
@@ -40,35 +38,27 @@ try
"test.properties",
"generated.properties",
"generate-test-sources.properties"
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ ]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyClass.java",
- "main.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyClass.java", "main.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/test-jar-no-fork/verify.groovy
b/src/it/test-jar-no-fork/verify.groovy
index 8889e38..e547339 100644
--- a/src/it/test-jar-no-fork/verify.groovy
+++ b/src/it/test-jar-no-fork/verify.groovy
@@ -17,56 +17,42 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/test-jar-no-fork-1.0-SNAPSHOT-test-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/test-jar-no-fork-1.0-SNAPSHOT-test-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
- String[] includedEntries = [
- "META-INF/MANIFEST.MF",
- "MyTest.java",
- "test.properties",
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] includedEntries = ["META-INF/MANIFEST.MF", "MyTest.java",
"test.properties",]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyClass.java",
- "main.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyClass.java", "main.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/test-jar/verify.groovy b/src/it/test-jar/verify.groovy
index eadf0ce..a0d7b49 100644
--- a/src/it/test-jar/verify.groovy
+++ b/src/it/test-jar/verify.groovy
@@ -17,57 +17,42 @@
* under the License.
*/
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.util.regex.*;
+import java.io.*
+import java.util.*
+import java.util.jar.*
+import java.util.regex.*
-try
-{
- File jarFile = new File( basedir,
"target/test-jar-1.0-SNAPSHOT-test-sources.jar" );
- System.out.println( "Checking for existence of " + jarFile );
- if ( !jarFile.isFile() )
- {
- System.out.println( "FAILURE!" );
- return false;
+try {
+ File jarFile = new File(basedir,
"target/test-jar-1.0-SNAPSHOT-test-sources.jar")
+ System.out.println("Checking for existence of " + jarFile)
+ if (!jarFile.isFile()) {
+ System.out.println("FAILURE!")
+ return false
}
- JarFile jar = new JarFile( jarFile );
+ JarFile jar = new JarFile(jarFile)
- String[] includedEntries = [
- "META-INF/MANIFEST.MF",
- "MyTest.java",
- "test.properties",
- "generated.properties",
- ];
- for ( String included : includedEntries )
- {
- System.out.println( "Checking for existence of " + included );
- if ( jar.getEntry( included ) == null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] includedEntries = ["META-INF/MANIFEST.MF", "MyTest.java",
"test.properties", "generated.properties",]
+ for (String included : includedEntries) {
+ System.out.println("Checking for existence of " + included)
+ if (jar.getEntry(included) == null) {
+ System.out.println("FAILURE!")
+ return false
}
}
- String[] excludedEntries = [
- "MyClass.java",
- "main.properties",
- ];
- for ( String excluded : excludedEntries )
- {
- System.out.println( "Checking for absence of " + excluded );
- if ( jar.getEntry( excluded ) != null )
- {
- System.out.println( "FAILURE!" );
- return false;
+ String[] excludedEntries = ["MyClass.java", "main.properties",]
+ for (String excluded : excludedEntries) {
+ System.out.println("Checking for absence of " + excluded)
+ if (jar.getEntry(excluded) != null) {
+ System.out.println("FAILURE!")
+ return false
}
}
}
-catch( Throwable t )
-{
- t.printStackTrace();
- return false;
+catch(Throwable t) {
+ t.printStackTrace()
+ return false
}
-return true;
+return true
diff --git a/src/it/verify-parameter-goal-generated-test-jar/verify.groovy
b/src/it/verify-parameter-goal-generated-test-jar/verify.groovy
index 8ce92b3..424257b 100644
--- a/src/it/verify-parameter-goal-generated-test-jar/verify.groovy
+++ b/src/it/verify-parameter-goal-generated-test-jar/verify.groovy
@@ -18,7 +18,7 @@
* under the License.
*/
-File buildLog = new File( basedir, 'build.log' )
+File buildLog = new File(basedir, 'build.log')
assert buildLog.exists()
diff --git a/src/it/verify-parameter-goal-jar-no-fork/verify.groovy
b/src/it/verify-parameter-goal-jar-no-fork/verify.groovy
index 7294aa6..a44f5a5 100644
--- a/src/it/verify-parameter-goal-jar-no-fork/verify.groovy
+++ b/src/it/verify-parameter-goal-jar-no-fork/verify.groovy
@@ -18,7 +18,7 @@
* under the License.
*/
-File buildLog = new File( basedir, 'build.log' )
+File buildLog = new File(basedir, 'build.log')
assert buildLog.exists()
diff --git a/src/it/verify-parameter-goal-jar/verify.groovy
b/src/it/verify-parameter-goal-jar/verify.groovy
index 1184d4a..166b1d2 100644
--- a/src/it/verify-parameter-goal-jar/verify.groovy
+++ b/src/it/verify-parameter-goal-jar/verify.groovy
@@ -18,7 +18,7 @@
* under the License.
*/
-File buildLog = new File( basedir, 'build.log' )
+File buildLog = new File(basedir, 'build.log')
assert buildLog.exists()
diff --git a/src/it/verify-parameter-goal-test-jar-no-fork/verify.groovy
b/src/it/verify-parameter-goal-test-jar-no-fork/verify.groovy
index 572b9bc..b490b6e 100644
--- a/src/it/verify-parameter-goal-test-jar-no-fork/verify.groovy
+++ b/src/it/verify-parameter-goal-test-jar-no-fork/verify.groovy
@@ -18,7 +18,7 @@
* under the License.
*/
-File buildLog = new File( basedir, 'build.log' )
+File buildLog = new File(basedir, 'build.log')
assert buildLog.exists()
diff --git a/src/it/verify-parameter-goal-test-jar/verify.groovy
b/src/it/verify-parameter-goal-test-jar/verify.groovy
index 8ce92b3..424257b 100644
--- a/src/it/verify-parameter-goal-test-jar/verify.groovy
+++ b/src/it/verify-parameter-goal-test-jar/verify.groovy
@@ -18,7 +18,7 @@
* under the License.
*/
-File buildLog = new File( basedir, 'build.log' )
+File buildLog = new File(basedir, 'build.log')
assert buildLog.exists()