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

When assembling a zip on windows duplicate files are added to the assembly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4, 2.4.1
    • 2.5
    • maven-archiver
    • None

    Description

      When assembling a zip where duplicate files are copied to the output directory the default behavior is for the first file to copy and the remaining ones to be skipped. When building a project on windows this is not the behavior. On Windows all the duplicate files are added to the final zip assembly.

      This was tested on OSX, CentOS, and Windows Server 2009 R2.

      Using OSX with these settings:

      Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 05:51:28-0800)
      Maven home: /usr/local/Cellar/maven30/3.0.5/libexec
      Java version: 1.7.0_60, vendor: Oracle Corporation
      Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre
      Default locale: en_US, platform encoding: UTF-8
      OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"
      

      Running the mvn build as such:

      mvn -X clean install
      

      You end up with this logged to the console:

      [INFO] Building zip: /Users/jasonl/Desktop/sample/target/sample.zip
      [DEBUG] adding directory sample/
      [DEBUG] adding directory sample/conf/
      [DEBUG] adding entry sample/conf/ConfFile.txt
      [DEBUG] adding entry sample/file.txt
      [DEBUG] sample/conf/ConfFile.txt already added, skipping
      

      When the final zip is examined there are no duplicate files. The plugin worked as intended. The same results were obtained in the CentOS test.

      The problem arises when you build on windows.

      Building with these settings:

      Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 05:51:28-0800)
      Maven home: C:\bin\apache-maven-3.0.5
      Java version: 1.7.0_60, vendor: Oracle Corporation
      Java home: C:\Program Files\Java\jdk1.7.0_60\jre
      Default locale: en_US, platform encoding: Cp1252
      OS name: "windows server 2008 r2", version: "6.1", arch: "amd64", family: "windows"
      

      And running the same mvn command:

      mvn -X clean install
      

      The following is output to the console:

      [INFO] Building zip: C:\Users\Administrator\Desktop\sample\target\sample.zip
      [DEBUG] adding directory sample/
      [DEBUG] adding directory sample/conf/
      [DEBUG] adding entry sample/conf/ConfFile.txt
      [DEBUG] adding entry sample/file.txt
      [DEBUG] adding entry sample/conf/ConfFile.txt
      

      As you can see the assembly did not skip the second ConfFile.txt addition. When the final zip assembly is examined there is infact 2 ConfFile.txt files under the conf directory.

      Attached is the sample I used.

      Attachments

        1. sample.zip
          2 kB
          Jason Lemay

        Issue Links

          Activity

            People

              krosenvold Kristian Rosenvold
              jasonl Jason Lemay
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: