[
https://issues.apache.org/jira/browse/MSHADE-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17516607#comment-17516607
]
Max Zerzouri commented on MSHADE-417:
-------------------------------------
bq. Not sure about your use case for null bytes, do you have some sample? Max
analyzis is right but also means we create a shade of nothing which sounds like
a project setup error.
As far as I can tell, this applies to normal usage of the shade plugin: reading
a file out of an existing jar and putting that file into a new jar.
When it's copying a file from an existing jar into the shaded jar, it checks to
see if the file within the jar is another zip/jar file, though I don't
understand the code enough or the problem involved in that PR to know why it
needs to have special handling for nested jars.
> Nul bytes appended to small files by maven-shade-plugin
> -------------------------------------------------------
>
> Key: MSHADE-417
> URL: https://issues.apache.org/jira/browse/MSHADE-417
> Project: Maven Shade Plugin
> Issue Type: Bug
> Affects Versions: 3.3.0
> Reporter: Max Zerzouri
> Priority: Major
> Attachments: original-shadetest-0.0.0.jar, pom.xml,
> shadetest-0.0.0.jar, test.txt
>
>
> Version 3.3.0 of maven shade plugin seems to append "\x00" bytes to a file if
> it's less than 4 bytes:
> {code:sh}
> $ echo -n a > src/main/resources/test.txt
> $ mvn clean install
> ...
> $ bsdtar -xOf target/original-shadetest-0.0.0.jar test.txt | xxd
> 00000000: 61 a
> $ bsdtar -xOf target/shadetest-0.0.0.jar test.txt | xxd
> 00000000: 6100 0000 a...
> {code}
> I've attached a basic {{pom.xml}} that triggers this. This doesn't occur in
> the previous version, 3.2.4.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)