You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Steinar Bang (Jira)" <ji...@apache.org> on 2019/12/30 23:45:00 UTC

[jira] [Commented] (MRELEASE-1025) release:prepare and release:update-version sets line endings to crlf for all lines except the first and last lines of the pom.xml files

    [ https://issues.apache.org/jira/browse/MRELEASE-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17005852#comment-17005852 ] 

Steinar Bang commented on MRELEASE-1025:
----------------------------------------

The behaviour is like this:
# The projects with the problem have never been on windows, they were created on linux and have been built on linux
# When "mvn release:prepare" is run the line with the <project> element and all lines until the last line gets CRLF instead of LF (i.e. the </project> line is left on LF)
# maven-release-plugin uses JDOM 1.1 https://github.com/apache/maven-release/blob/master/pom.xml#L202
# JDOM 1.1 use CRLF for line endings when writing
## http://www.jdom.org/pipermail/jdom-interest/2011-November/016544.html
## https://github.com/hunterhacker/jdom/issues/53
# JDOM 2 has a way to override this behaviour http://www.jdom.org/docs/apidocs/org/jdom2/output/LineSeparator.html
# For most of my projects the commits created with "mvn release:prepare" are broken, e.g. like so http://www.jdom.org/docs/apidocs/org/jdom2/output/LineSeparator.html
# For one of my projects the working directory is broken by "mvn release:prepare" but the commits created by release:prepare are OK https://github.com/steinarb/authservice/commit/03bf0ca5ae89e1f8bd87a5b405d80888cb62c2cb
# I've been unable to find any difference between the authservice project and the rest of them

> release:prepare and release:update-version sets line endings to crlf for all lines except the first and last lines of the pom.xml files
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-1025
>                 URL: https://issues.apache.org/jira/browse/MRELEASE-1025
>             Project: Maven Release Plugin
>          Issue Type: Bug
>    Affects Versions: 2.5.3
>         Environment: debian 9.8 "stretch", amd64, openjdk 8u212-b01-1~deb9u1, maven 3.3.9-4
>            Reporter: Steinar Bang
>            Priority: Major
>              Labels: debian-issue
>
> For these two projects
> * https://github.com/steinarb/authservice
> * https://github.com/steinarb/osgi-service
> line endings in the pom.xml files are messed up when I do
> {noformat}
> mvn release:prepare
> {noformat}
> or bump versions with e.g. 
> {noformat}
> mvn --batch-mode release:update-versions -DdevelopmentVersion=1.0.2-SNAPSHOT
> {noformat}
> What happens to the line endings are:
> # First line stays at lf
> # Last line stays at lf
> # All of the intervening lines get crlf
> # The line endings were initially lf (at least they were meant to be)
> # I run the "mvn release:prepare" and "mvn:update-version" commands from a command line on Debian GNU/linux



--
This message was sent by Atlassian Jira
(v8.3.4#803005)