michael-o commented on a change in pull request #119:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/119#discussion_r549040428



##########
File path: 
src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
##########
@@ -322,18 +326,20 @@ private boolean isUpdToDate( String cpString )
     }
 
     /**
-     * It stores the specified string into that file.
+     * Stores the specified string into that file.
      *
-     * @param cpString the string to be written into the file.
-     * @throws MojoExecutionException
+     * @param cpString the string to write into the file
      */
     private void storeClasspathFile( String cpString, File out )
         throws MojoExecutionException
     {
         // make sure the parent path exists.
         out.getParentFile().mkdirs();
+        
+        String encoding = getProject().getProperties().getProperty( 
"project.reporting.outputEncoding", "UTF-8" );
 
-        try ( Writer w = new BufferedWriter( new FileWriter( out ) ) )
+        try ( Writer w =

Review comment:
       Why the pain? `Files.newBufferedWriter(...)`?

##########
File path: 
src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
##########
@@ -322,18 +326,20 @@ private boolean isUpdToDate( String cpString )
     }
 
     /**
-     * It stores the specified string into that file.
+     * Stores the specified string into that file.
      *
-     * @param cpString the string to be written into the file.
-     * @throws MojoExecutionException
+     * @param cpString the string to write into the file
      */
     private void storeClasspathFile( String cpString, File out )
         throws MojoExecutionException
     {
         // make sure the parent path exists.
         out.getParentFile().mkdirs();
+        
+        String encoding = getProject().getProperties().getProperty( 
"project.reporting.outputEncoding", "UTF-8" );

Review comment:
       This line does not make sense anymore.

##########
File path: 
src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
##########
@@ -366,7 +372,10 @@ protected String readClasspathFile()
             return null;
         }
         StringBuilder sb = new StringBuilder();
-        try ( BufferedReader r = new BufferedReader( new FileReader( 
outputFile ) ) )
+        String encoding = outputEncoding == null ? "UTF-8" : outputEncoding;

Review comment:
       I'd copy the same method from MSITE to here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to