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

Shading of paths starting with / ignores excludes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.1.1
    • None

    Description

      This commit addressed rewriting of resource paths that start with a slash, e.g. /org/my/company/resource.txt : https://github.com/apache/maven-plugins/commit/c438ed843883b06cd72a5d3086d01ef534e39ebe

       

      However, this rewriting ignores excludes.

      It accounts for a leading slash when determining whether a path should be relocated: https://github.com/apache/maven-plugins/blob/maven-shade-plugin-3.0.0/src/main/java/org/apache/maven/plugins/shade/relocation/SimpleRelocator.java#L186

      And replaces the first occurrence anywhere within it (so also ignores leading slash): https://github.com/apache/maven-plugins/blob/maven-shade-plugin-3.0.0/src/main/java/org/apache/maven/plugins/shade/relocation/SimpleRelocator.java#L202

      However it applies excludes only at the exact beginning of the path: https://github.com/apache/maven-plugins/blob/maven-shade-plugin-3.0.0/src/main/java/org/apache/maven/plugins/shade/relocation/SimpleRelocator.java#L158

       

      So /org/my/company/resource.txt gets relocated even if org.my.company.** is in the excludes list.

      Attachments

        Activity

          People

            gboue Guillaume Boué
            jkff Eugene Kirpichov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: