You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2023/01/03 21:43:02 UTC

[GitHub] [maven-integration-testing] psiroky commented on a diff in pull request #223: [MNG-7661] Use provided scope for Maven deps in IT plugins

psiroky commented on code in PR #223:
URL: https://github.com/apache/maven-integration-testing/pull/223#discussion_r1060978463


##########
core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/coreit/SettingsReadItMojo.java:
##########
@@ -59,22 +58,14 @@ public void execute()
             dumpFile.delete();
         }
         dumpFile.getParentFile().mkdirs();
-        FileWriter fw = null;
-        try
+        try ( FileWriter fw = new FileWriter( dumpFile ) )
         {
-            fw = new FileWriter( dumpFile );
             SettingsXpp3Writer writer = new SettingsXpp3Writer();
             writer.write( fw, settings );
         }
         catch ( IOException e )
         {
             throw new MojoExecutionException( e.getMessage(), e );
         }
-        finally
-        {
-            IOUtil.close( fw );
-        }
     }

Review Comment:
   These simple changes are to avoid the direct dependency on plexus-utils in this plugin (as it is brought in by one the maven deps, which are now in provided scope - and thus pluxus-utils ends up in provided scope as well.)



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

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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