Maven Assembly Plugin
  1. Maven Assembly Plugin
  2. MASSEMBLY-449

Permissions on directories in a zipped archive incorrect

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2-beta-4
    • Fix Version/s: 2.4
    • Component/s: permissions
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Using the following assembly plugin:

      <assembly>
          <id>target-packaged</id>
          <formats>
              <format>zip</format>
          </formats>
          <includeBaseDirectory>false</includeBaseDirectory>
          <moduleSets>
              <moduleSet>
                  <includes>
                      <include>*:core-env</include>
                  </includes>
                  <binaries>
                      <attachmentClassifier>env</attachmentClassifier>
                      <includeDependencies>false</includeDependencies>
                      <unpack>true</unpack>
                  </binaries>
              </moduleSet>
              <moduleSet>
                  <includes>
                      <include>*:data-bridge</include>
                  </includes>
                  <binaries>
                      <attachmentClassifier>target</attachmentClassifier>
                      <includeDependencies>false</includeDependencies>
                      <unpack>true</unpack>
                  </binaries>
              </moduleSet>
              <moduleSet>
                  <includes>
                      <include>*:web</include>
                  </includes>
                  <binaries>
                      <attachmentClassifier>web</attachmentClassifier>
                      <includeDependencies>false</includeDependencies>
                      <unpack>true</unpack>
                  </binaries>
              </moduleSet>
          </moduleSets>
      </assembly>
      

      When unzipping the result on a Linux host all the directory permissions have been set to 777.
      If I revert the plugin version to 2.2-beta-3 the issue goes away.

        Issue Links

          Activity

          Hide
          Leo Leung added a comment -

          The workaround provided by Andreas Veithen no longer works with version 2.3 .
          I get the following exception when I try to add the <archiverConfig> configuration to get around this issue:

          [INFO] ------------------------------------------------------------------------
          [ERROR] FATAL ERROR
          [INFO] ------------------------------------------------------------------------
          [INFO] null
          [INFO] ------------------------------------------------------------------------
          [DEBUG] Trace
          java.lang.NullPointerException
                  at org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributeUtils.mergeAttributes(PlexusIoResourceAttributeUtils.java:70)
                  at org.codehaus.plexus.components.io.resources.PlexusIoFileResourceCollection.addResources(PlexusIoFileResourceCollection.java:149)
                  at org.codehaus.plexus.components.io.resources.PlexusIoFileResourceCollection.getResources(PlexusIoFileResourceCollection.java:195)
                  at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext(AbstractArchiver.java:455)
                  at org.apache.maven.plugin.assembly.filter.ComponentsXmlArchiverFileFilter.finalizeArchiveCreation(ComponentsXmlArchiverFileFilter.java:166)
                  at org.codehaus.plexus.archiver.AbstractArchiver.runArchiveFinalizers(AbstractArchiver.java:871)
                  at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:895)
                  at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiver.createArchive(AssemblyProxyArchiver.java:512)
                  at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:185)
                  at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:452)
                  at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
                  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
                  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
                  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
                  at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
                  at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                  at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
          [INFO] ------------------------------------------------------------------------
          
          
          Show
          Leo Leung added a comment - The workaround provided by Andreas Veithen no longer works with version 2.3 . I get the following exception when I try to add the <archiverConfig> configuration to get around this issue: [INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] null [INFO] ------------------------------------------------------------------------ [DEBUG] Trace java.lang.NullPointerException at org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributeUtils.mergeAttributes(PlexusIoResourceAttributeUtils.java:70) at org.codehaus.plexus.components.io.resources.PlexusIoFileResourceCollection.addResources(PlexusIoFileResourceCollection.java:149) at org.codehaus.plexus.components.io.resources.PlexusIoFileResourceCollection.getResources(PlexusIoFileResourceCollection.java:195) at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext(AbstractArchiver.java:455) at org.apache.maven.plugin.assembly.filter.ComponentsXmlArchiverFileFilter.finalizeArchiveCreation(ComponentsXmlArchiverFileFilter.java:166) at org.codehaus.plexus.archiver.AbstractArchiver.runArchiveFinalizers(AbstractArchiver.java:871) at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:895) at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiver.createArchive(AssemblyProxyArchiver.java:512) at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:185) at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:452) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] ------------------------------------------------------------------------
          Hide
          Kristian Rosenvold added a comment -

          @Leo Leung You need to update the plexus-io dependency of the assembly plugin to 2.0.3, which will arrive in maven central in a few hours

          Show
          Kristian Rosenvold added a comment - @Leo Leung You need to update the plexus-io dependency of the assembly plugin to 2.0.3, which will arrive in maven central in a few hours
          Hide
          Leo Leung added a comment -

          @Kristian Rosenvold Thanks for that. Overriding the dependency to plexus-io 2.0.3 worked.

          Show
          Leo Leung added a comment - @Kristian Rosenvold Thanks for that. Overriding the dependency to plexus-io 2.0.3 worked.
          Hide
          Julien Nicoulaud added a comment -

          I can still see this bug in 2.4. The workaround with the archiverConfig works.

          Show
          Julien Nicoulaud added a comment - I can still see this bug in 2.4. The workaround with the archiverConfig works.
          Hide
          Robert Metzger added a comment -

          I can confirm that the bug still exists with 2.4.

          Show
          Robert Metzger added a comment - I can confirm that the bug still exists with 2.4.

            People

            • Assignee:
              Unassigned
              Reporter:
              James Kavanagh
            • Votes:
              14 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: