Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1.0
-
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.