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

Markus Karg edited comment on MSHADE-313 at 4/5/19 6:01 PM:
------------------------------------------------------------

I see your point but as I think we should not decide things for the application 
programmer I had in mind the "keepServices" option you wanted me to remove...!

In fact, the real-world scenario is that "Main" actually WOULD reference the 
service indirectly. So if you like I can add that to the "Main" class to 
express this intent.

But what actually to do with your personal dislike then in case an application 
programmer actually does want the case I artifically drafted to answer your 
questions? Tell them that robert dislilkes his style of coding, re-adding 
"keepServices", or adding the explicit excludes I proposed in the other PR?

Proposal: I add a check to the minijar filter that only those services are kept 
that actually are referenced by "Main". Good?


was (Author: mkarg):
I see your point but as I think we should not decide things for the application 
programmer I had in mind the "keepServices" option you wanted me to remove...!

In fact, the real-world scenario is that "Main" actually WOULD reference the 
service indirectly. So if you like I can add that to the "Main" class to 
express this intent.

But what actually to do with your personal dislike then in case an application 
programmer actually does want the case I artifically drafted to answer your 
questions? Tell them that robert dislilkes his style of coding, re-adding 
"keepServices", or adding the explicit excludes I proposed in the other PR?

> Less agressive <minimizeJar>
> ----------------------------
>
>                 Key: MSHADE-313
>                 URL: https://issues.apache.org/jira/browse/MSHADE-313
>             Project: Maven Shade Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.2.1
>            Reporter: Markus Karg
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The maven shade plugin already does a great job in minimizing JAR size. For 
> the majority of applications this is exactly what is needed.
> On the other hand there are some application areas where the algorithm is too 
> agressive. One particular and rather frequently found case is the services 
> API: ServiceLoader will ceise to work for minimized JARs since it is the 
> prototype of the biggest "minimize-JAR-antipattern": String-to-class 
> conversion.
> To make <minimizeJar> usable in such scenarios, there should be a set of 
> options to enable the usual suspetcs (like ServiceLoader) to be detected.



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

Reply via email to