Uploaded image for project: 'Maven Shade Plugin'
  1. Maven Shade Plugin
  2. MSHADE-305

Filters are merged by index, not by artifactId

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.0.0
    • None
    • None
    • Maven 3.2.5, Windows&Unix

    Description

      When filters are defined in both a parent and child module they are merged by index, and not by artifactId.

      For example, consider these 2 filters:

      Parent:

      <filter>
          <artifact>IDontEvenExist</artifact>
          <excludes>
              <exclude>**</exclude>
          </excludes>
      </filter>
      

      Child:

      <filter>
          <artifact>org.apache.flink:IncludedModule</artifact>
          <includes>
              <include>**</include>
          </includes>
      </filter>
      

      Despite the filters being defined for distinct artifacts they are still merged into the following filter, which excludes everything from IncludedModule.

      <filter>
          <artifact>org.apache.flink:IncludedModule</artifact>
          <includes>
              <include>**</include>
          </includes>
          <excludes>
              <exclude>**</exclude>
          </excludes>
      </filter>
      

      I have attached a reproducer.

      A trivial workaround is to add combine.children="append" to <filters>.

      I would expect that either filters are merged by artifactId or at the very least a warning is printed if filters are merged this way.

      Attachments

        1. reproducer.zip
          8 kB
          Chesnay Schepler

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              chesnay Chesnay Schepler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: