Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-769

ZIP fileMode permissions not properly set with dependencySet and unpackOptions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.3, 2.5.4
    • Fix Version/s: 2.5.5
    • Component/s: None
    • Labels:
      None

      Description

      This issue first appeared in 2.5.3 and applies to an assembly with filtered dependencies and fileMode set, as in here:

          <dependencySet>
            <outputDirectory>/</outputDirectory>
            <includes>
              <include>test:child1</include>
            </includes>
            <useTransitiveDependencies>true</useTransitiveDependencies>
            <useTransitiveFiltering>true</useTransitiveFiltering>
            <useProjectArtifact>false</useProjectArtifact>
            <unpack>true</unpack>
            <unpackOptions>
              <includes>
                  <include>l4g</include>
                  <include>l4g.cmd</include>
              </includes>
            </unpackOptions>
            <fileMode>0755</fileMode>
          </dependencySet>
      

      The output ZIP had proper file mode flags in 2.5.2, but from 2.5.3 on it's incorrect.

      Steps to reproduce:

      unzip example.zip
      cd example
      mvn clean package
      zipinfo child2/target/*.zip
      

      Output (slightly trimmed) for 2.5.3 and 2.5.4:

      Archive:  c:\_tmp\example\example\child2\target\foo-1.0-SNAPSHOT-private.zip
      Zip file size: 565 bytes, number of entries: 4
      drwxr-xr-x  2.0 unx        0 b- stor 15-May-18 13:45 foo-1.0-SNAPSHOT/
      -rw-r--r--  2.0 unx        3 bl defN 15-May-18 13:45 foo-1.0-SNAPSHOT/l4g
      -rw-r--r--  2.0 unx        3 bl defN 15-May-18 13:45 foo-1.0-SNAPSHOT/l4g.cmd
      

      output for 2.5.2 (note the 'x' flag for ``l4g`` files):

      Archive:  c:\_tmp\example\example\child2\target\foo-1.0-SNAPSHOT-private.zip
      Zip file size: 565 bytes, number of entries: 4
      drwxr-xr-x  2.0 unx        0 b- stor 15-May-18 13:47 foo-1.0-SNAPSHOT/
      -rwxr-xr-x  2.0 unx        3 bl defN 15-May-18 13:47 foo-1.0-SNAPSHOT/l4g
      -rwxr-xr-x  2.0 unx        3 bl defN 15-May-18 13:47 foo-1.0-SNAPSHOT/l4g.cmd
      

        Attachments

        1. example.zip
          3 kB
          Dawid Weiss

          Activity

            People

            • Assignee:
              krosenvold Kristian Rosenvold
              Reporter:
              dweiss Dawid Weiss
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: