PR: MPCHANGES-32

The encoding of the changes.xml file is not preserved after doing release-version.
New property maven.changes.outputencoding.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@434555 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl 2006-08-24 22:55:52 +00:00
parent 7757b3af9c
commit 137cb3f9dd
5 changed files with 31 additions and 3 deletions

View File

@ -112,9 +112,9 @@
<define:tag name="release-version">
<j:useBean var="transformer" class="org.apache.maven.changes.ReleaseVersion"/>
<util:file var="f" name="${maven.docs.src}/changes.xml" />
<!-- Set default encoding if not set. -->
<!-- Set encoding if not set. -->
<j:if test="${encoding == null}">
<j:set var="encoding" value="${maven.docs.outputencoding}" />
<j:set var="encoding" value="${maven.changes.outputencoding}" />
</j:if>
<j:choose>
<j:when test="${date != null}">

View File

@ -47,3 +47,6 @@ maven.changes.sort = false
# Decide the sort order for action types
maven.changes.sort.order = add,fix,update,remove
# To force an encoding for the changes.xml file
# maven.changes.outputencoding =

View File

@ -120,7 +120,18 @@ public class ReleaseVersion
format.setIndentSize( 2 );
format.setNewlines( true );
format.setTrimText( true );
format.setEncoding( encoding );
if ( encoding == null || "".equals( encoding ) )
{
String docsEncoding = doc.getXMLEncoding();
if ( docsEncoding != null )
{
format.setEncoding( docsEncoding );
}
}
else
{
format.setEncoding( encoding );
}
XMLWriter writer = new XMLWriter( format );
writer.setOutputStream( os );

View File

@ -24,6 +24,8 @@
</properties>
<body>
<release version="1.6.1-SNAPSHOT" date="In SVN">
<action dev="ltheussl" type="fix" issue="MPCHANGES-32">The encoding of the changes.xml file is not preserved after doing release-version.</action>
<action dev="ltheussl" type="add">New property maven.changes.outputencoding.</action>
<action dev="ltheussl" type="update">Update dom4j dependency to match the one in maven 1.1 core.</action>
<action dev="aheritier" type="update" issue="MAVEN-1753">Replace the deprecated xmlParserAPIs by xml-apis 1.3.03.</action>
<action dev="aheritier" type="update">Upgrade to commons-io 1.2.</action>

View File

@ -77,6 +77,18 @@
add,fix,update,remove
</td>
</tr>
<tr>
<td>maven.changes.outputencoding</td>
<td>Yes</td>
<td>
Sets the encoding for the changes.xml file when using
the release-version tag. This can be useful to ensure
the same encoding for all files.
</td>
<td>
Default is empty, so the encoding of changes.xml will be preserved.
</td>
</tr>
</table>
</section>
</body>