[
https://issues.apache.org/jira/browse/MSHADE-400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17699194#comment-17699194
]
Alexander Kriegisch commented on MSHADE-400:
--------------------------------------------
[~michael-o], can you please respond to my [question in the
PR|https://github.com/apache/maven-shade-plugin/pull/110#issuecomment-1455059620]?
First you had asked me for improvements in the code review, but then you did
not merge the commit containing them, but only my first commit, which you
slightly altered.
> Self-minimisation with custom entry points
> ------------------------------------------
>
> Key: MSHADE-400
> URL: https://issues.apache.org/jira/browse/MSHADE-400
> Project: Maven Shade Plugin
> Issue Type: New Feature
> Affects Versions: 3.2.4
> Reporter: Alexander Kriegisch
> Assignee: Michael Osipov
> Priority: Major
> Fix For: 3.5.0
>
>
> While discussing MSHADE-366, [~rmannibucau] refused to merge a simple
> workaround suppressing the warning {{target/classes (access denied)}} during
> minimisation (option {{minimizeJar}}), suggesting that instead directories
> should be handled as a first-class class container, just like dependency JARs.
> * He implemented that for {{DefaultShader}}, which has no effect on
> minimisation.
> * So I also implemented it for {{MinijarFilter}}. To my surprise, it had no
> effect either, because minimisation is currently just implemented for
> dependencies, not for the target module itself.
> So what we need here is *self-minimisation*, i.e. removal of unneeded classes
> in the target module itself. For boot-strapping reasons - we need starting
> points for class dependency analysis - it is necessary to add a new plugin
> parameter {{entryPoints}}, taking a set of fully-qualified class names as its
> input. If present and {{minimizeJar}} is active, it will treat only the
> defined entry points (e.g. classes with main methods, but can be any type of
> class) as starting points for dependency analysis instead of all classes of
> the target module.
> This feature should also correctly consider [Java Service Provider
> (SPI)|https://www.baeldung.com/java-spi] configuration files according to the
> implementation of MSHADE-313. I.e., services are to be considered as entry
> points if and only if there is an SPI config file and something like
> {{ServiceLoader.load( MyServiceProvider.class )}} is present in a Java entry
> point class or one of its (transitive) dependency classes. In that case, both
> the service provider interface and all implementations defined in the SPI
> config file are being kept in the minimised JAR. Due to unified handling of
> directories and JARs as input sources for minimisation, this should work
> transparently.
> I already have a first implementation which I am going to push and link to
> this issue soon.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)