mirror of https://github.com/apache/maven.git
[MNG-3503] replaced FileWriter with encoding aware writer
git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@705518 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c0a5ae7668
commit
4e1d21b0b5
|
@ -1,7 +1,9 @@
|
|||
package org.apache.maven.its.plugins;
|
||||
|
||||
import java.io.FileWriter;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
@ -27,11 +29,11 @@ public class SerializeMojo
|
|||
public void execute()
|
||||
throws MojoExecutionException, MojoFailureException
|
||||
{
|
||||
FileWriter writer = null;
|
||||
Writer writer = null;
|
||||
XmlSerializer s = new MXSerializer();
|
||||
try
|
||||
{
|
||||
writer = new FileWriter( filename );
|
||||
writer = new OutputStreamWriter( new FileOutputStream( filename ), "UTF-8" );
|
||||
s.setOutput( writer );
|
||||
|
||||
Xpp3Dom dom = new Xpp3Dom( "root" );
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package org.apache.maven.its.plugins;
|
||||
|
||||
import java.io.FileWriter;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
|
@ -27,11 +29,11 @@ public class SerializeMojo
|
|||
public void execute()
|
||||
throws MojoExecutionException, MojoFailureException
|
||||
{
|
||||
FileWriter writer = null;
|
||||
Writer writer = null;
|
||||
XmlSerializer s = new MXSerializer();
|
||||
try
|
||||
{
|
||||
writer = new FileWriter( filename );
|
||||
writer = new OutputStreamWriter( new FileOutputStream( filename ), "UTF-8" );
|
||||
s.setOutput( writer );
|
||||
|
||||
Xpp3Dom dom = new Xpp3Dom( "root" );
|
||||
|
|
Loading…
Reference in New Issue