From 353cd5bac453a1ba698f9fb905b11e868ac00d2c Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Tue, 23 Oct 2007 12:56:21 +0000 Subject: [PATCH] [MNG-2254] support XML file encoding when writing settings git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@587489 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/maven/embedder/MavenEmbedder.java | 4 ++-- .../org/apache/maven/embedder/MavenEmbedderFileLogger.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java index 6cf1ab320e..0b16fa2014 100644 --- a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java +++ b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java @@ -80,10 +80,10 @@ import org.codehaus.plexus.configuration.PlexusConfigurationException; import org.codehaus.plexus.logging.LoggerManager; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.WriterFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; -import java.io.FileWriter; import java.io.IOException; import java.io.Reader; import java.io.Writer; @@ -263,7 +263,7 @@ public class MavenEmbedder SettingsXpp3Writer writer = new SettingsXpp3Writer(); - Writer fileWriter = new FileWriter( file ); + Writer fileWriter = WriterFactory.newXmlWriter( file ); try { diff --git a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderFileLogger.java b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderFileLogger.java index 933cede70a..057e2e3c19 100644 --- a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderFileLogger.java +++ b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderFileLogger.java @@ -37,7 +37,7 @@ public final class MavenEmbedderFileLogger { try { - this.log = new PrintWriter( new FileWriter( logFile ) ); + this.log = new PrintWriter( new FileWriter( logFile ) ); // platform encoding } catch ( IOException e ) {