Uploaded image for project: 'Maven Shade Plugin'
  1. Maven Shade Plugin
  2. MSHADE-417

Fix null bytes appended to small files by maven-shade-plugin

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.4.1
    • None

    Description

      Version 3.3.0 of maven shade plugin seems to append "\x00" bytes to a file if it's less than 4 bytes:

      $ 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...
      

      I've attached a basic pom.xml that triggers this. This doesn't occur in the previous version, 3.2.4.

      Attachments

        1. original-shadetest-0.0.0.jar
          2 kB
          Max Zerzouri
        2. pom.xml
          1.0 kB
          Max Zerzouri
        3. shadetest-0.0.0.jar
          2 kB
          Max Zerzouri
        4. test.txt
          0.0 kB
          Max Zerzouri

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              max.zerzouri.solnet Max Zerzouri
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: