From f1ead6c9e818192ed38e8a578ed0bf03aac91ff0 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Tue, 30 Oct 2007 21:29:43 +0000 Subject: [PATCH] added XML encoding support when reading POM file git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@590473 13f79535-47bb-0310-9956-ffa450edef68 --- maven-plugin-testing-harness/pom.xml | 2 +- .../apache/maven/plugin/testing/AbstractMojoTestCase.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/maven-plugin-testing-harness/pom.xml b/maven-plugin-testing-harness/pom.xml index 2cd6243..6abb84a 100644 --- a/maven-plugin-testing-harness/pom.xml +++ b/maven-plugin-testing-harness/pom.xml @@ -45,7 +45,7 @@ org.codehaus.plexus plexus-utils - 1.4.2 + 1.4.5 org.codehaus.plexus diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java index 9e616be..7cfa715 100644 --- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java +++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/AbstractMojoTestCase.java @@ -27,12 +27,12 @@ import org.codehaus.plexus.component.configurator.ComponentConfigurator; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; import org.codehaus.plexus.configuration.PlexusConfiguration; import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; +import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.ReflectionUtils; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.codehaus.plexus.util.xml.Xpp3DomBuilder; import java.io.File; -import java.io.FileReader; import java.io.Reader; import java.util.Map; import java.util.HashMap; @@ -114,7 +114,7 @@ public abstract class AbstractMojoTestCase { File pluginPom = new File( getBasedir(), "pom.xml" ); - Xpp3Dom pluginPomDom = Xpp3DomBuilder.build( new FileReader( pluginPom ) ); + Xpp3Dom pluginPomDom = Xpp3DomBuilder.build( ReaderFactory.newXmlReader( pluginPom ) ); String artifactId = pluginPomDom.getChild( "artifactId" ).getValue(); @@ -140,7 +140,7 @@ public abstract class AbstractMojoTestCase { File pluginPom = new File( getBasedir(), "pom.xml" ); - Xpp3Dom pluginPomDom = Xpp3DomBuilder.build( new FileReader( pluginPom ) ); + Xpp3Dom pluginPomDom = Xpp3DomBuilder.build( ReaderFactory.newXmlReader( pluginPom ) ); String artifactId = pluginPomDom.getChild( "artifactId" ).getValue(); @@ -207,7 +207,7 @@ public abstract class AbstractMojoTestCase protected PlexusConfiguration extractPluginConfiguration( String artifactId, File pom ) throws Exception { - Reader reader = new FileReader( pom ); + Reader reader = ReaderFactory.newXmlReader( pom ); Xpp3Dom pomDom = Xpp3DomBuilder.build( reader );