@@ -230,6 +230,26 @@ public abstract class AbstractWarMojo extends AbstractMojo {
230230 @ Parameter
231231 private String dependentWarExcludes = StringUtils .join (Overlay .DEFAULT_EXCLUDES , "," );
232232
233+ /**
234+ * The comma separated list of tokens to exclude from the WAR before packaging. This option may be used to implement
235+ * the skinny WAR use case. Note that you can use the Java Regular Expressions engine to include and exclude
236+ * specific pattern using the expression %regex[]. Hint: read the about (?!Pattern).
237+ *
238+ * @since 2.1-alpha-2
239+ */
240+ @ Parameter (property = "maven.war.packagingExcludes" )
241+ private String packagingExcludes ;
242+
243+ /**
244+ * The comma separated list of tokens to include in the WAR before packaging. By default everything is included.
245+ * This option may be used to implement the skinny WAR use case. Note that you can use the Java Regular Expressions
246+ * engine to include and exclude specific pattern using the expression %regex[].
247+ *
248+ * @since 2.1-beta-1
249+ */
250+ @ Parameter
251+ private String packagingIncludes ;
252+
233253 /**
234254 * The overlays to apply. Each <overlay> element may contain:
235255 * <ul>
@@ -826,6 +846,24 @@ public void deleteOutdatedResources() {
826846 public String getOutputTimestamp () {
827847 return outputTimestamp ;
828848 }
849+
850+ /**
851+ * @return list of packaging excludes.
852+ * @since 3.4.1
853+ */
854+ @ Override
855+ public List <String > getPackagingExcludes () {
856+ return Arrays .asList (AbstractWarMojo .this .getPackagingExcludes ());
857+ }
858+
859+ /**
860+ * @return list of packaging includes.
861+ * @since 3.4.1
862+ */
863+ @ Override
864+ public List <String > getPackagingIncludes () {
865+ return Arrays .asList (AbstractWarMojo .this .getPackagingIncludes ());
866+ }
829867 }
830868
831869 /**
@@ -1044,4 +1082,40 @@ protected boolean isRecompressZippedFiles() {
10441082 protected boolean isIncludeEmptyDirectories () {
10451083 return includeEmptyDirectories ;
10461084 }
1085+
1086+ /**
1087+ * @return The package excludes.
1088+ */
1089+ public String [] getPackagingExcludes () {
1090+ if (packagingExcludes == null || packagingExcludes .isEmpty ()) {
1091+ return new String [0 ];
1092+ } else {
1093+ return org .codehaus .plexus .util .StringUtils .split (packagingExcludes , "," );
1094+ }
1095+ }
1096+
1097+ /**
1098+ * @param packagingExcludes {@link #packagingExcludes}
1099+ */
1100+ public void setPackagingExcludes (String packagingExcludes ) {
1101+ this .packagingExcludes = packagingExcludes ;
1102+ }
1103+
1104+ /**
1105+ * @return The packaging includes.
1106+ */
1107+ public String [] getPackagingIncludes () {
1108+ if (packagingIncludes == null || packagingIncludes .isEmpty ()) {
1109+ return new String [] {"**" };
1110+ } else {
1111+ return org .codehaus .plexus .util .StringUtils .split (packagingIncludes , "," );
1112+ }
1113+ }
1114+
1115+ /**
1116+ * @param packagingIncludes {@link #packagingIncludes}
1117+ */
1118+ public void setPackagingIncludes (String packagingIncludes ) {
1119+ this .packagingIncludes = packagingIncludes ;
1120+ }
10471121}
0 commit comments