apache / apache/maven-shade-plugin

[MSHADE-356] Include filters with minimizeJar do not work with single class file

Open
#524 0 comments 0 reactions 0 assignees View on GitHub
bug priority:minor
Dominant language
Java
Stars
188
Forks
103
Avg merge
16h 39m
Merged PRs (30d)
4

Description

**[Dan Ziemba](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=zman0900)** opened **[MSHADE-356](https://issues.apache.org/jira/browse/MSHADE-356?redirect=false)** and commented

When using the minimizeJar feature, it is possible to explicitly include some classes that would have otherwise been excluded: MSHADE-111.  The documentation shows a filter like this:

```xml

foo:bar
false

foo/Bar.class

```

This does not seem to actually work.  If class Bar is not actually referenced, it is still removed from the shaded jar. 

Using a wildcard include pattern like "`foo/\*`" or "`foo/Bar\*`" will work, but including the period like "`foo/Bar.\*foo/Bar`".

It seems that the include pattern actually matches on the class name, not the class file name.  Is this a documentation bug, or a bug with the minimizeJar feature?

---

**Affects:** 3.2.2

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the minimizeJar behavior with the XML filter examples in this issue, comparing a single .class include with wildcard patterns. Trace where include patterns are matched and determine whether class-file extensions are supported. Done when the behavior matches the documented filter syntax or the documentation clearly describes the supported pattern.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.