[ 
https://jira.codehaus.org/browse/MASSEMBLY-637?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stephen Colebourne updated MASSEMBLY-637:
-----------------------------------------

    Attachment: MASSEMBLY-637.patch

Please find attached the patch to fix this issue. I am an ASF committer.

The patch moves the encoding logic from {{FileFormatter}} to 
{{AssemblyFileUtils}}. This is necessary to get access to the {{File}} object 
so that the existing end-of-file line ending can be queried. That is then used 
to fix the bug without breaking MASSEMBLY-96.

I have added a {{Boolean}} parameter {{atEndOfFile}} to the 
{{AssemblyFileUtils}} method so that a future enhancement can add a new 
configuration item to the assembly desriptor file - "newLineAtEndOfFile" - 
which would have values "retain" (the default), "ensure" and "remove" (where 
"ensure" is the interesting value, adding a new line at the end of the file if 
it is missing). I haven't change the assembly descriptor to keep this patch 
simple.

Please apply this patch, as this is a pretty serious bug IMO.
                
> fileSet <lineEnding>unix</lineEnding> strips last newline of file
> -----------------------------------------------------------------
>
>                 Key: MASSEMBLY-637
>                 URL: https://jira.codehaus.org/browse/MASSEMBLY-637
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.4
>         Environment: Linux ws117v6226517 2.6.32-5-686 #1 SMP Sun Sep 23 
> 09:49:36 UTC 2012 i686 GNU/Linux
> Apache Maven 3.0.4 (r1232337; 2012-01-17 01:44:56-0700)
> Maven home: /usr/local/lib/apache-maven-3.0.4
> Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
> Java home: /usr/local/lib/jdk1.6.0_33/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "2.6.32-5-686", arch: "i386", family: "unix"
>            Reporter: deckrider
>         Attachments: MASSEMBLY-637.patch
>
>
> using <fileSet><lineEnding>unix</lineEnding> strips last newline of file when 
> building on Linux platform (not sure about other platforms)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to