Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.2.4
-
None
Description
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) 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.
Attachments
Issue Links
- is related to
-
MSHADE-366 The warning "Access denied" during 'minimizeJar' is always printed
-
- Closed
-
- links to