[MPLUGIN-93] Use correct encoding for plugin-registry.xml

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@643567 13f79535-47bb-0310-9956-ffa450edef68
master
Benjamin Bentmann 2008-04-01 21:04:34 +00:00
parent 0d658ca66e
commit fde717b3ad
1 changed files with 4 additions and 3 deletions

View File

@ -30,11 +30,12 @@ import org.apache.maven.plugin.registry.PluginRegistryUtils;
import org.apache.maven.plugin.registry.TrackableBase; import org.apache.maven.plugin.registry.TrackableBase;
import org.apache.maven.plugin.registry.io.xpp3.PluginRegistryXpp3Writer; import org.apache.maven.plugin.registry.io.xpp3.PluginRegistryXpp3Writer;
import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.WriterFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import java.io.File; import java.io.File;
import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.Writer;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
@ -166,12 +167,12 @@ public class UpdatePluginRegistryMojo
// only rewrite the user-level registry if one existed before, or if we've created user-level data here. // only rewrite the user-level registry if one existed before, or if we've created user-level data here.
if ( extractedUserRegistry != null ) if ( extractedUserRegistry != null )
{ {
FileWriter fWriter = null; Writer fWriter = null;
try try
{ {
pluginRegistryFile.getParentFile().mkdirs(); pluginRegistryFile.getParentFile().mkdirs();
fWriter = new FileWriter( pluginRegistryFile ); fWriter = WriterFactory.newXmlWriter( pluginRegistryFile );
PluginRegistryXpp3Writer writer = new PluginRegistryXpp3Writer(); PluginRegistryXpp3Writer writer = new PluginRegistryXpp3Writer();