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



##########
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:
       missed that one. Fixed. 

##########
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:
       Maybe just
   
   ```
           String encoding = Objects.toString( outputEncoding, "UTF-8" );
   ```
   

##########
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:
       Old habits mostly, but looking at that it requires as much code to 
change types (File --> Path, String --> charset, boolean --> FileOption) that 
it's equally complex. 




----------------------------------------------------------------
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