[ 
https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816509#comment-16816509
 ] 

Markus Karg commented on MSHADE-316:
------------------------------------

[~rfscholte] No, this is a misunderstanding. The idea is *not* to have full 
control over the classes being added. The idea is (see also my PR) is to 
*prevent minjar's removal of explicitly marked classes*. Use case: A dependency 
shall get included into a shaded jar, but that dependency is loaded by 
*Reflection*, so the original artifact does not directly reference the *Class* 
to load, but only holds a *String* with the class name. The Minijar filter will 
remove that class, so the shaded JAR will be broken. With my PR, you can add an 
_explicit minijar exemption_ on that single class name (or pattern), so minijar 
will keep that file even *without a technically detectable* need. This cannot 
be done with the existing include filters, because once _at least one_ include 
is explictly defined, the default (include _all_) is switched off so _all_ 
other classes would be _excluded_. The solution is my PR which simply provides 
an *exemption* for Minijar. There is a rather popular real-life scenario: 
Minijar breaks _Eclipse Jersey_ because one of Jersey's dependency is loaded by 
Reflection.

> Explicit minijar includes
> -------------------------
>
>                 Key: MSHADE-316
>                 URL: https://issues.apache.org/jira/browse/MSHADE-316
>             Project: Maven Shade Plugin
>          Issue Type: Improvement
>            Reporter: Markus Karg
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Minijar currently respects includes, but these have a drawback: Once you 
> defined an include, the _default includes_ are gone! But what you actually 
> want to have when combining minijar with includes is just an "exception" to 
> minijar's filtering, not a complete replacement of the default includes!
> So what we need to make this work intuitively is either "explicit minijar 
> exceptions", or a "useDefaultIncludes=true" option that turns the notion from 
> "replace default includes by the single given include" to "add the single 
> given include ontop of the default includes".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to