Maven 1.x Release Plugin

The encoding of the project.xml file is not preserved after doing release:transform

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.5
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP Pro, Maven 1.0.2, release-plugin 1.4.1.
  • Number of attachments :
    1

Description

This is similar in concept to MPCHANGES-24.

The encoding of the original project.xml file is not preserved when it is written back after the transformation. This means that my file was converted from ISO-8859-1 to UTF-8, which is the default encoding used by dom4j. Without a UTF-8 compliant editor I can't edit the file any more, because I use non-us-ascii character in the file.

The solution should be similar and the place to make the change is in this file:
http://svn.apache.org/viewcvs.cgi/maven/maven-1/plugins/trunk/release/src/main/org/apache/maven/release/AbstractPomTransformer.java
The method write() needs to get a hold of the original file's encoding, and do
format.setEncoding(<original-encoding>);

Activity

Hide
Dennis Lundberg added a comment -

This patch is inspired by Lukas' fix for MPCHANGES-24.

It adds a new write method in AbstractPomTransformer.java that takes an encoding parameter. In plugin-jelly this new write method is used everywhere. I have tested the goal release:update-pom, the other goals are modified in a similar way.

The missing thing in the patch is a suitable developer in changes.xml.

Show
Dennis Lundberg added a comment - This patch is inspired by Lukas' fix for MPCHANGES-24. It adds a new write method in AbstractPomTransformer.java that takes an encoding parameter. In plugin-jelly this new write method is used everywhere. I have tested the goal release:update-pom, the other goals are modified in a similar way. The missing thing in the patch is a suitable developer in changes.xml.
Hide
Lukas Theussl added a comment -

Patch applied. Thanks!

Show
Lukas Theussl added a comment - Patch applied. Thanks!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: