PR: MPRELEASE-12

Submitted by: Dennis Lundberg

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


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@354890 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl 2005-12-07 23:00:04 +00:00
parent 92fa78ba90
commit 1f76ad543b
3 changed files with 35 additions and 4 deletions

View File

@ -128,8 +128,12 @@
<j:set var="required" value="${transformer.transformRequired()}" /> <j:set var="required" value="${transformer.transformRequired()}" />
<j:if test="${required}"> <j:if test="${required}">
<ant:echo>Updating POM with version ${version}; tag ${tag}</ant:echo> <ant:echo>Updating POM with version ${version}; tag ${tag}</ant:echo>
<!-- Set default encoding if not set. -->
<j:if test="${encoding == null}">
<j:set var="encoding" value="${maven.docs.outputencoding}" />
</j:if>
${transformer.transformNodes()} ${transformer.transformNodes()}
${transformer.write()} ${transformer.write(encoding)}
</j:if> </j:if>
</define:tag> </define:tag>
</define:taglib> </define:taglib>
@ -189,8 +193,12 @@
default="yes"/> default="yes"/>
<j:if test="${answer == 'yes'}"> <j:if test="${answer == 'yes'}">
<!-- Set default encoding if not set. -->
<j:if test="${encoding == null}">
<j:set var="encoding" value="${maven.docs.outputencoding}" />
</j:if>
<!-- Write out the pom. --> <!-- Write out the pom. -->
${transformer.write()} ${transformer.write(encoding)}
</j:if> </j:if>
</j:if> </j:if>
@ -203,7 +211,11 @@
transformations="transformations"/> transformations="transformations"/>
${transformer.transformNodes()} ${transformer.transformNodes()}
${transformer.write()} <!-- Set default encoding if not set. -->
<j:if test="${encoding == null}">
<j:set var="encoding" value="${maven.docs.outputencoding}" />
</j:if>
${transformer.write(encoding)}
</goal> </goal>
@ -212,7 +224,11 @@
transformer="transformer" transformer="transformer"
transformations="transformations"/> transformations="transformations"/>
${transformer.transformNodes()} ${transformer.transformNodes()}
${transformer.write()} <!-- Set default encoding if not set. -->
<j:if test="${encoding == null}">
<j:set var="encoding" value="${maven.docs.outputencoding}" />
</j:if>
${transformer.write(encoding)}
</goal> </goal>
<!-- <!--

View File

@ -300,6 +300,16 @@ public abstract class AbstractPomTransformer
*/ */
public void write() public void write()
throws Exception throws Exception
{
write( null );
}
/**
*
* @throws Exception
*/
public void write( String encoding )
throws Exception
{ {
OutputStream os = null; OutputStream os = null;
@ -320,6 +330,10 @@ public abstract class AbstractPomTransformer
format.setIndentSize( 2 ); format.setIndentSize( 2 );
format.setNewlines( true ); format.setNewlines( true );
format.setTrimText( true ); format.setTrimText( true );
if ( encoding != null )
{
format.setEncoding( encoding );
}
XMLWriter writer = new XMLWriter( format ); XMLWriter writer = new XMLWriter( format );
writer.setOutputStream( os ); writer.setOutputStream( os );

View File

@ -26,6 +26,7 @@
</properties> </properties>
<body> <body>
<release version="1.5-SNAPSHOT" date="In SVN"> <release version="1.5-SNAPSHOT" date="In SVN">
<action dev="ltheussl" type="fix" issue="MPRELEASE-12" due-to="Dennis Lundberg">The encoding of the project.xml file is not preserved after doing <code>release:transform</code>.</action>
<action dev="brett" type="fix" issue="MPRELEASE-11">handle non-jar dependencies</action> <action dev="brett" type="fix" issue="MPRELEASE-11">handle non-jar dependencies</action>
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated : <action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated :
<ul> <ul>