What is the difference between `warSourceExcludes` and` packagingExcludes` in Maven

The Maven WAR plugin has two configuration options: warSourceExcludesand packagingExcludes. There is some documentation , saying: packagingExcludes packagingExcludes

You can include or exclude specific files from the WAR file using the <packagingIncludes>and configuration options <packagingExcludes>.

However, it is very difficult for me to find information about warSourceExcludes.

What is the difference between these two configuration options?

I am using Maven 3.1.1 and the WAR plugin version 2.4

+5
source share
2 answers

warSourceExcludes: comma separated list of tokens to exclude when copying the contents of warSourceDirectory.


packagingExcludes: , , WAR .

Excludes, .

warSourceExcludes, .

, webappDirectory, , warSourceExcludes, .

+11

:

  1. - ${warSourceDirectory} ${<webappDirectory>}, :

    cp -r src/main/webapp/* target/artifact/
    

    <warSourceExcludes> , .

  2. war ${webappDirectory}, ${webappDirectory} target/<artifact>, :

    jar --create --file target/artifact.war -C target/artifact/ WEB-INF ...
    

    <packagingExcludes>, , .

. https://maven.apache.org/plugins/maven-war-plugin/war-mojo.html.

0

Source: https://habr.com/ru/post/1525887/


All Articles