Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2-beta-1
    • Fix Version/s: 2.2-beta-3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows Vista
    • Number of attachments :
      2

      Description

      I have a parent project and a child project. The child project builds an assembly composed of text files.

      <fileSet>
      <outputDirectory>bin</outputDirectory>
      <directory>src/main/bin</directory>
      <lineEnding>unix</lineEnding>
      <includes>
      <include>*.sh</include>
      </includes>
      </fileSet>

      When I build the assembly from the child project , maven adds unix endings, but when I build it from the parent project, lineEnding is being ignored.

        Issue Links

          Activity

          Hide
          Sergei Ivanov added a comment - - edited

          We have also stumbled upon this bug and I decided to find out the root cause. I checked out the plugin sources and added extra tracing info to the plugin code. After a few test runs, I realised that the bug can be fixed with a change in a single line of code.

          class/method:
          org.apache.maven.plugin.assembly.format.FileSetFormatter#formatFileSetForAssembly

          patch against version 628941:

          @@ -57,7 +57,7 @@
          -            fileSet.setDirectory( set.getDirectory() );
          +            fileSet.setDirectory( archiveBaseDir.getPath() );
          

          Is there a chance that it will be included in the next release?

          Show
          Sergei Ivanov added a comment - - edited We have also stumbled upon this bug and I decided to find out the root cause. I checked out the plugin sources and added extra tracing info to the plugin code. After a few test runs, I realised that the bug can be fixed with a change in a single line of code. class/method: org.apache.maven.plugin.assembly.format.FileSetFormatter#formatFileSetForAssembly patch against version 628941: @@ -57,7 +57,7 @@ - fileSet.setDirectory( set.getDirectory() ); + fileSet.setDirectory( archiveBaseDir.getPath() ); Is there a chance that it will be included in the next release?
          Hide
          Sergei Ivanov added a comment -

          This is a test project I used to reproduce the problem.

          Show
          Sergei Ivanov added a comment - This is a test project I used to reproduce the problem.
          Hide
          Petar Tahchiev added a comment -

          Hi Sergei and Todor,

          If you are going to execute Maven from the parent then you should specify the full-path to your directory filesets. If you are going to execute Maven from the child module you can specify either relative or full-path to your directory fileset, like this:

          <fileSet>
          <!-- Copy Unix shell scripts, make sure that line ending is LF and an execution permission is set -->
          <directory>/home/peter/workspace/test/module/src/main/bin</directory>
          <outputDirectory>bin</outputDirectory>
          <includes>
          <include>*.sh</include>
          <include>*.ksh</include>
          <include>*.pl</include>
          </includes>
          <fileMode>0744</fileMode><!-- rwxr..r.. -->
          <lineEnding>unix</lineEnding>
          </fileSet>

          You see how I have specified the complete path to the directory in my fileset?

          In my opnion the maven-assembly should NOT be changed, but I provide a patch if anyone wants to change it. I just add the basedir property to your fileset directory property. In this case you have to specify the directory as relative path.

          HTH, Petar.

          Show
          Petar Tahchiev added a comment - Hi Sergei and Todor, If you are going to execute Maven from the parent then you should specify the full-path to your directory filesets. If you are going to execute Maven from the child module you can specify either relative or full-path to your directory fileset, like this: <fileSet> <!-- Copy Unix shell scripts, make sure that line ending is LF and an execution permission is set --> <directory>/home/peter/workspace/test/module/src/main/bin</directory> <outputDirectory>bin</outputDirectory> <includes> <include>*.sh</include> <include>*.ksh</include> <include>*.pl</include> </includes> <fileMode>0744</fileMode><!-- rwxr..r.. --> <lineEnding>unix</lineEnding> </fileSet> You see how I have specified the complete path to the directory in my fileset? In my opnion the maven-assembly should NOT be changed, but I provide a patch if anyone wants to change it. I just add the basedir property to your fileset directory property. In this case you have to specify the directory as relative path. HTH, Petar.
          Hide
          Petar Tahchiev added a comment -

          Here is the patch. Again IMHO maven devs should NOT apply it .

          Show
          Petar Tahchiev added a comment - Here is the patch. Again IMHO maven devs should NOT apply it .
          Hide
          John Casey added a comment -

          Fixed by fix for MASSEMBLY-293. I've added two new integration tests to verify this, one for windows and one for unix line endings.

          Show
          John Casey added a comment - Fixed by fix for MASSEMBLY-293 . I've added two new integration tests to verify this, one for windows and one for unix line endings.

            People

            • Assignee:
              John Casey
              Reporter:
              Todor Todorov
            • Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: