Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-368

Configure plexus-archiver to use java.io.File methods to set permissions when available.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5
    • 2.5.1
    • unpack, unpack-dependencies
    • None
    • Patch

    Description

      We updated from maven-dependency-plugin 2.4 to 2.5 in our build, and found that it slowed down significantly. Our build process involves unpacking several large zip files, and profiling the build showed us that the extra time was spent in Plexus Archiver's ArchiveEntryUtils.chmod, where it was executing a chmod process for each file in the archive.

      We tracked this change to an update of the Plexus Archiver dependency from 2.0 to 2.1.1 in version 2.5 of the Maven Dependency Plugin: http://svn.apache.org/viewvc?view=revision&revision=1292983

      Plexus Archiver can be configured to use the setReadable, setWritable and setExecutable methods on java.io.File instead of executing chmod. These methods are new in Java 6, but Plexus Archiver invokes them using reflection when they are available, falling back on executing chmod when they are not, so it remains backwards compatible with Java 5.

      This configuration is disabled by default, but can be configured via Plexus. The attached patch to Maven Dependency Plugin sets the archiver components to use the JVM implementation when available.

      The patch doesn't include tests, since the behavior is dependent on the Java version used, but when applied all of the existing tests pass in Java 6.

      Credit for the investigation and the patch is due to Vincent Choy (vchoy@atlassian.com). He asked me to file this issue on his behalf.

      Attachments

        1. useJvmChmod.patch
          5 kB
          Tim Moore

        Activity

          People

            olamy Olivier Lamy
            tmoore Tim Moore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: