From be8d3ee0fb7437cb6b9d0d1f679661b47fc2d079 Mon Sep 17 00:00:00 2001 From: lprimak Date: Tue, 23 Sep 2025 14:33:26 -0500 Subject: [PATCH 1/2] enh: uses packagingExclude / include parameters for all goals, not just war:war goal --- .../maven/plugins/war/AbstractWarMojo.java | 74 +++++++++++++++++++ .../org/apache/maven/plugins/war/WarMojo.java | 57 -------------- .../packaging/AbstractWarPackagingTask.java | 28 +++++++ .../war/packaging/WarPackagingContext.java | 12 +++ 4 files changed, 114 insertions(+), 57 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java b/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java index 2a357b05..434ed379 100644 --- a/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java +++ b/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java @@ -230,6 +230,26 @@ public abstract class AbstractWarMojo extends AbstractMojo { @Parameter private String dependentWarExcludes = StringUtils.join(Overlay.DEFAULT_EXCLUDES, ","); + /** + * The comma separated list of tokens to exclude from the WAR before packaging. This option may be used to implement + * the skinny WAR use case. Note that you can use the Java Regular Expressions engine to include and exclude + * specific pattern using the expression %regex[]. Hint: read the about (?!Pattern). + * + * @since 2.1-alpha-2 + */ + @Parameter(property = "maven.war.packagingExcludes") + private String packagingExcludes; + + /** + * The comma separated list of tokens to include in the WAR before packaging. By default everything is included. + * This option may be used to implement the skinny WAR use case. Note that you can use the Java Regular Expressions + * engine to include and exclude specific pattern using the expression %regex[]. + * + * @since 2.1-beta-1 + */ + @Parameter + private String packagingIncludes; + /** * The overlays to apply. Each <overlay> element may contain: *