From 920ed8b06fd6b19cf9a1cc89be5a35f0a5a33304 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Thu, 30 Oct 2014 18:01:18 +0200 Subject: [PATCH] MNG-5486 hiding transfer logs --- .../src/main/java/org/apache/maven/cli/CLIManager.java | 4 +++- .../src/main/java/org/apache/maven/cli/MavenCli.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java index 04e31b30ea53..b120928672eb 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java @@ -97,6 +97,8 @@ public class CLIManager public static final String THREADS = "T"; + public static final String QUIET_TRANSFER_LOGS = "qtl"; + public static final String LEGACY_LOCAL_REPOSITORY = "llr"; public static final String BUILDER = "b"; @@ -137,6 +139,7 @@ public CLIManager() options.addOption( OptionBuilder.withLongOpt( "encrypt-master-password" ).hasOptionalArg().withDescription( "Encrypt master security password" ).create( ENCRYPT_MASTER_PASSWORD ) ); options.addOption( OptionBuilder.withLongOpt( "encrypt-password" ).hasOptionalArg().withDescription( "Encrypt server password" ).create( ENCRYPT_PASSWORD ) ); options.addOption( OptionBuilder.withLongOpt( "threads" ).hasArg().withDescription( "Thread count, for instance 2.0C where C is core multiplied" ).create( THREADS ) ); + options.addOption( OptionBuilder.withLongOpt( "quiet_transfer_logs" ).withDescription( "quiets transfer logs, for example: downloading, uploading, bytes downloaded, etc.." ).create( QUIET_TRANSFER_LOGS) ); options.addOption( OptionBuilder.withLongOpt( "legacy-local-repository" ).withDescription( "Use Maven 2 Legacy Local Repository behaviour, ie no use of _remote.repositories. Can also be activated by using -Dmaven.legacyLocalRepo=true" ).create( LEGACY_LOCAL_REPOSITORY ) ); options.addOption( OptionBuilder.withLongOpt( "builder" ).hasArg().withDescription( "The id of the build strategy to use." ).create( BUILDER ) ); @@ -154,7 +157,6 @@ public CommandLine parse( String[] args ) String[] cleanArgs = cleanArgs( args ); CommandLineParser parser = new GnuParser(); - return parser.parse( options, cleanArgs ); } 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 cde88cbfff7b..7cb1ec7cf3b8 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 @@ -924,7 +924,7 @@ else if ( profileAction.startsWith( "+" ) ) TransferListener transferListener; - if ( quiet ) + if ( quiet || cliRequest.commandLine.hasOption(CLIManager.QUIET_TRANSFER_LOGS) ) { transferListener = new QuietMavenTransferListener(); }