You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Rafael Winterhalter (JIRA)" <ji...@apache.org> on 2018/09/19 08:18:00 UTC

[jira] [Created] (MSHADE-300) Allow retention of module-info class by property

Rafael Winterhalter created MSHADE-300:
------------------------------------------

             Summary: Allow retention of module-info class by property
                 Key: MSHADE-300
                 URL: https://issues.apache.org/jira/browse/MSHADE-300
             Project: Maven Shade Plugin
          Issue Type: New Feature
    Affects Versions: 3.2.0
            Reporter: Rafael Winterhalter


Currently, the shader removes any module-info.class file that is found during the shading process. This makes perfect sense as the integrity of the module-info class file breaks as a result of the relocation and any potential renaming.

Many library vendors that use the shade plugin do so to import minor dependencies into their namespace. In my case, I depend on ASM and use another Maven plugin to generate a module-info.class file which does not require ASM and would work correctly. Unfortunately, this working module-info.class file is filtered out by the shade plugin.

To overcome this limitation, I suggest adding a 'retainModuleInfo' property that allows for the retention of the module-info.class file that is extracted from the main artifact. I understand that this might be an edge case but given the module system only being partially adopted it would help some low-level library vendors like myself a lot if this feature would be included in the plugin.

I have attached a patch file that implements this feature and it only requires minimal changes in the plugin. I have also validated that this feature works for my project (Byte Buddy).

If you could merge and release this extension, I would hope to include module descriptors in Byte Buddy in the upcoming Java 11-compatible release. Thanks a lot!



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