Author: hboutemy
Date: Wed Oct 24 14:26:14 2007
New Revision: 588037

URL: http://svn.apache.org/viewvc?rev=588037&view=rev
Log:
read and write pom with UTF-8 instead of platform encoding

Modified:
    
maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java
    
maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java

Modified: 
maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java?rev=588037&r1=588036&r2=588037&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/AbstractInstallMojo.java
 Wed Oct 24 14:26:14 2007
@@ -26,8 +26,6 @@
 import org.apache.maven.plugin.MojoExecutionException;
 import org.codehaus.plexus.digest.Digester;
 import org.codehaus.plexus.digest.DigesterException;
-import org.codehaus.plexus.digest.Md5Digester;
-import org.codehaus.plexus.digest.Sha1Digester;
 import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;

Modified: 
maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java?rev=588037&r1=588036&r2=588037&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-install-plugin/src/main/java/org/apache/maven/plugin/install/InstallFileMojo.java
 Wed Oct 24 14:26:14 2007
@@ -37,11 +37,14 @@
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
 import java.io.Reader;
+import java.io.Writer;
 import java.net.MalformedURLException;
 import java.util.Map;
 
@@ -171,7 +174,7 @@
                 ArtifactRepositoryLayout layout;
 
                 layout = ( ArtifactRepositoryLayout ) repositoryLayouts.get( 
repositoryLayout );
-                
+
                 getLog().info("Layout: " + layout.getClass());
                 localRepository = new DefaultArtifactRepository( 
localRepositoryId, localRepositoryPath.toURL()
                     .toString(), layout );
@@ -209,7 +212,7 @@
         // TODO: check if it exists first, and default to true if not
         if ( generatePom )
         {
-            FileWriter fw = null;
+            Writer fw = null;
             try
             {
                 File tempFile = File.createTempFile( "mvninstall", ".pom" );
@@ -222,7 +225,8 @@
                 model.setVersion( version );
                 model.setPackaging( packaging );
                 model.setDescription( "POM was created from 
install:install-file" );
-                fw = new FileWriter( tempFile );
+                // TODO use WriterFactory.newXmlWriter() when plexus-utils is 
upgraded to 1.4.5+
+                fw = new OutputStreamWriter( new FileOutputStream( tempFile ), 
"UTF-8" );
                 tempFile.deleteOnExit();
                 new MavenXpp3Writer().write( fw, model );
                 metadata = new ProjectArtifactMetadata( artifact, tempFile );
@@ -298,7 +302,8 @@
         Reader reader = null;
         try
         {
-            reader = new FileReader( aFile );
+            // TODO use ReaderFactory.newXmlReader() when plexus-utils is 
upgraded to 1.4.5+
+            reader = new InputStreamReader( new FileInputStream( aFile ), 
"UTF-8" );
 
             MavenXpp3Reader mavenReader = new MavenXpp3Reader();
 


Reply via email to