By default, the packagingIncludes maven-war-plugin attribute will contain everything under src/main/webapp . When you override it to indicate
<packagingIncludes>css_${css}/**</packagingIncludes>
then the plugin will only include this folder (and everything under it), rather than WEB-INF . A simple solution is to re-enable WEB-INF :
<packagingIncludes>WEB-INF/**,css_${css}/**</packagingIncludes>
With this configuration, everything under WEB-INF and everything under css_${css} will be included in the war.
Another solution that does not require re-adding folders would be instead of <packagingExcludes> . Thus, all files under src/main/webapp will be included, except for those that we specify here. In this case, we can use a regular expression that says: exclude everything that starts with css and not css_${css} .
<packagingExcludes>%regex[css_(?!${css}/).*]</packagingExcludes>
source share