You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "BlakeTNC (JIRA)" <ji...@apache.org> on 2016/07/08 01:09:11 UTC

[jira] [Comment Edited] (MSHADE-230) Cannot specify custom manifest file in a shaded jar.

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

BlakeTNC edited comment on MSHADE-230 at 7/8/16 1:08 AM:
---------------------------------------------------------

I found a solution for replacing the manifest file created by Shade, but this solution is not optimal. An ideal solution would allow me to append my own lines of text to the existing manifest file created by Shade, while retaining my own empty lines and line ordering. That way the shaded manifest output could be retained. 

I posted the pom code for my solution here (look for the answer authored by BlakeTNC):

http://stackoverflow.com/questions/38243222/how-can-i-specify-a-custom-manifest-mf-file-while-using-the-maven-shade-plugin


was (Author: blaketnc):
I found a solution for replacing the manifest file created by Shade, but this solution is not optimal. An ideal solution would allow me to -append- my own lines of text to the existing manifest file created by Shade, while retaining my own empty lines and line ordering. That way the shaded manifest output could be retained. 

I posted the pom code for my solution here (look for the answer authored by BlakeTNC):

http://stackoverflow.com/questions/38243222/how-can-i-specify-a-custom-manifest-mf-file-while-using-the-maven-shade-plugin

> Cannot specify custom manifest file in a shaded jar.
> ----------------------------------------------------
>
>                 Key: MSHADE-230
>                 URL: https://issues.apache.org/jira/browse/MSHADE-230
>             Project: Maven Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 2.4.3
>            Reporter: BlakeTNC
>
> When a project uses the maven-jar-plugin, it's easy to include a custom (hand written) manifest file in the jar, but I can't find a way to do the same thing with maven shade. How can I use my own manifest file while using the "maven-shade-plugin"? 
> Basic details:
> My custom manifest file is located in "src/main/resources/META-INF/MANIFEST.MF". Shade is not including my file, instead it is being replaced in the final jar with a default manifest file.
> The reason I need a custom manifest file is to specify some JavaBeans classes in my manifest, for a swing component library. Multiple JavaBeans classes should be specified in the manifest file in the following format, as described here: http://www.ewebprogrammer.com/java-beans/module3/javabeans-manifest-file.jsp  (Note that the order of these lines is important, as well as the empty lines between them. The ManifestResourceTransformer could add the lines, but they get added out of order and without the empty lines.)
> Name: SomeBean1.class
> Java-Bean: True
> Name: SomeBean2.class
> Java-Bean: True
> Name: SomeBean3.class
> Java-Bean: True
> The POM file for this project is long, so I won't paste the whole thing here. However, the current full POM for this project can be seen on github at this link: https://github.com/LGoodDatePicker/LGoodDatePicker/blob/master/Project/pom.xml
> See the list of (unsuccessful) solutions I have tried (and additional details), which are located here. 
> http://stackoverflow.com/questions/38243222/how-can-i-specify-a-custom-manifest-mf-file-while-using-the-maven-shade-plugin
> Thank you.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)