diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 175cfdab3a..10d21a2b84 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -39,9 +39,7 @@ import org.apache.maven.InternalErrorException; import org.apache.maven.Maven; import org.apache.maven.cli.event.DefaultEventSpyContext; import org.apache.maven.cli.event.ExecutionEventLogger; -import org.apache.maven.cli.logging.PrintStreamLogger; import org.apache.maven.cli.logging.Slf4jLoggerManager; -import org.apache.maven.cli.transfer.BatchModeMavenTransferListener; import org.apache.maven.cli.transfer.ConsoleMavenTransferListener; import org.apache.maven.cli.transfer.QuietMavenTransferListener; import org.apache.maven.cli.transfer.Slf4jMavenTransferListener; @@ -321,28 +319,31 @@ public class MavenCli { File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) ); logFile = resolveFile( logFile, cliRequest.workingDirectory ); - System.setProperty("org.slf4j.simpleLogger.logFile", logFile.getAbsolutePath()); - try { - PrintStream ps = new PrintStream(new FileOutputStream(logFile)); - System.setOut(ps); - System.setErr(ps); - } catch (FileNotFoundException e) { - // - // Ignore - // + System.setProperty( "org.slf4j.simpleLogger.logFile", logFile.getAbsolutePath() ); + try + { + PrintStream ps = new PrintStream( new FileOutputStream( logFile ) ); + System.setOut( ps ); + System.setErr( ps ); + } + catch ( FileNotFoundException e ) + { + // + // Ignore + // } } - plexusLoggerManager = new Slf4jLoggerManager(); + plexusLoggerManager = new Slf4jLoggerManager(); slf4jLoggerFactory = LoggerFactory.getILoggerFactory(); - slf4jLogger = slf4jLoggerFactory.getLogger(this.getClass().getName()); + slf4jLogger = slf4jLoggerFactory.getLogger( this.getClass().getName() ); } private void version( CliRequest cliRequest ) { if ( cliRequest.debug || cliRequest.commandLine.hasOption( CLIManager.SHOW_VERSION ) ) { - System.out.print(CLIReportingUtils.showVersion()); + System.out.print( CLIReportingUtils.showVersion() ); } } diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/BatchModeMavenTransferListener.java b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/BatchModeMavenTransferListener.java index ddecc62736..ca65d943a7 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/BatchModeMavenTransferListener.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/BatchModeMavenTransferListener.java @@ -2,8 +2,6 @@ package org.apache.maven.cli.transfer; import java.io.PrintStream; -import org.slf4j.Logger; - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file