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

lineEnding parameter makes assembly ignore empty directories

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2-beta-2
    • 2.5
    • None
    • None
    • Windows 7 Enterprise x64 sp1
      Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
      Java version: 1.6.0_25

    Description

      Empty directories are ignored if the lineEnding parameter is used in a fileset.
      Created archive will contain empty directories if I either remove the lineEnding parameter OR remove any text file from the directory structure.

      structure:

      pom.xml
      src/main/assembly/assembly.xml
      src/main/include/a/test.txt
                      /b/
      

      pom.xml

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
      
          <groupId>test</groupId>
          <artifactId>test</artifactId>
          <version>0-SNAPSHOT</version>
          <packaging>pom</packaging>
          <name>test</name>
      
          <build>
              <plugins>
                  <plugin>
                      <artifactId>maven-assembly-plugin</artifactId>
                      <configuration>
                          <appendAssemblyId>false</appendAssemblyId>
                          <attach>false</attach>
                          <descriptors>
                              <descriptor>src/main/assembly/assembly.xml</descriptor>
                          </descriptors>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
      </project>
      

      assembly.xml

      <assembly
              xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
          <id>distribution</id>
      
          <formats>
              <format>tar.gz</format>
          </formats>
      
          <fileSets>
              <fileSet>
                  <directory>src/main/include</directory>
                  <outputDirectory>/</outputDirectory>
                  <lineEnding>unix</lineEnding>
              </fileSet>
          </fileSets>
      </assembly>
      

      test

      mvn clean assembly:single
      
      set MAVEN_OPTS="-Xmx256m"
      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [INFO] Building test
      [INFO]    task-segment: [clean, assembly:single]
      [INFO] ------------------------------------------------------------------------
      [INFO] [clean:clean {execution: default-clean}]
      [INFO] Deleting directory C:\ATM\emptybug\trunk\target
      [INFO] [assembly:single {execution: default-cli}]
      [INFO] Reading assembly descriptor: src/main/assembly/assembly.xml
      [INFO] Building tar : C:\ATM\emptybug\trunk\target\test-0-SNAPSHOT.tar.gz
      [WARNING] Assembly file: C:\ATM\emptybug\trunk\target\test-0-SNAPSHOT.tar.gz is not a regular file (
      it may be a directory). It cannot be attached to the project build for installation or deployment.
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1 second
      [INFO] Finished at: Thu Oct 06 09:06:23 EDT 2011
      [INFO] Final Memory: 8M/162M
      [INFO] ------------------------------------------------------------------------
      bsdtar ztvf target\test-0-SNAPSHOT.tar.gz
      drwxr-xr-x  0 0      0           0 Oct 06 09:06 test-0-SNAPSHOT/
      drwxr-xr-x  0 0      0           0 Oct 06 09:06 test-0-SNAPSHOT/a/
      -rw-r--r--  0 0      0           0 Oct 06 09:06 test-0-SNAPSHOT/a/test.txt
      

      without lineEnding

      Attachments

        1. pom.xml
          0.9 kB
          Elie Prudhomme
        2. assembly.xml
          0.6 kB
          Elie Prudhomme

        Issue Links

          Activity

            People

              krosenvold Kristian Rosenvold
              Elie Elie Prudhomme
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: