From c847c9ac2a88a5e7087066d1905c7dce5d4d6464 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Sun, 23 Nov 2025 13:39:38 -0600 Subject: [PATCH] Don't add default empty list to excludes --- .../maven/plugins/source/AbstractSourceJarMojo.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java b/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java index d8f1747..5d56ac1 100644 --- a/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java +++ b/src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java @@ -56,8 +56,6 @@ public abstract class AbstractSourceJarMojo implements Mojo { private static final String[] DEFAULT_INCLUDES = new String[] {"**/**"}; - private static final String[] DEFAULT_EXCLUDES = new String[] {}; - /** * List of files to include. Specified as fileset patterns which are relative to the input directory whose contents * is being packaged into the JAR. @@ -542,7 +540,7 @@ private String[] getCombinedIncludes(List additionalIncludes) { /** * Combines the user parameter {@link #excludes}, the default excludes from plexus FileUtils, and the contents of - * the parameter addionalExcludes. + * the parameter additionalExcludes. * * @param additionalExcludes Additional excludes to add to the array * @return The combined list of excludes. @@ -562,10 +560,6 @@ private String[] getCombinedExcludes(List additionalExcludes) { combinedExcludes.addAll(additionalExcludes); } - if (combinedExcludes.isEmpty()) { - combinedExcludes.addAll(Arrays.asList(DEFAULT_EXCLUDES)); - } - return combinedExcludes.toArray(new String[0]); }