kdebski85 commented on a change in pull request #589:
URL: https://github.com/apache/maven/pull/589#discussion_r817613991
##########
File path: maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
##########
@@ -553,9 +553,8 @@ else if ( cliRequest.commandLine.hasOption(
CLIManager.BATCH_MODE )
logFile = resolveFile( logFile, cliRequest.workingDirectory );
// redirect stdout and stderr to file
- try
+ try ( PrintStream ps = new PrintStream( new FileOutputStream(
logFile ) ) )
Review comment:
PrintStream `ps` should not be closed here because it is passed to
`System.setOut` and `System.setErr`. It will be automatically closed when
`try-with-resource` block ends.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]