diff --git a/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java b/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java
index 45f9ffc8..53730df7 100644
--- a/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java
+++ b/src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java
@@ -342,6 +342,14 @@ public abstract class AbstractInvokerMojo
@Parameter( property = "invoker.debug", defaultValue = "false" )
private boolean debug;
+ /**
+ * Whether to execute Maven in quiet mode.
+ *
+ * @since 3.3.0
+ */
+ @Parameter( property = "invoker.quiet", defaultValue = "false" )
+ private boolean quiet;
+
/**
* Suppress logging to the build.log
file.
*
@@ -561,6 +569,11 @@ public abstract class AbstractInvokerMojo
* # can be indexed
* invoker.debug = true
*
+ * # Whether to execute Maven in quiet mode
+ * # Since plugin version 3.3.0
+ * # can be indexed
+ * invoker.quiet = true
+ *
* The execution timeout in seconds.
* # Since plugin version 3.0.2
* # can be indexed
@@ -2660,6 +2673,7 @@ private InvokerProperties getInvokerProperties( final File projectDirectory, Pro
// set default value for Invoker - it will be used if not present in properties
invokerProperties.setDefaultDebug( debug );
+ invokerProperties.setDefaultQuiet( quiet );
invokerProperties.setDefaultGoals( goals );
invokerProperties.setDefaultProfiles( profiles );
invokerProperties.setDefaultMavenExecutable( mavenExecutable );
diff --git a/src/main/java/org/apache/maven/plugins/invoker/InvokerProperties.java b/src/main/java/org/apache/maven/plugins/invoker/InvokerProperties.java
index ecebdcdd..93e48768 100644
--- a/src/main/java/org/apache/maven/plugins/invoker/InvokerProperties.java
+++ b/src/main/java/org/apache/maven/plugins/invoker/InvokerProperties.java
@@ -49,6 +49,7 @@ class InvokerProperties
// default values from Mojo configuration
private Boolean defaultDebug;
+ private Boolean defaultQuiet;
private List defaultGoals;
private List defaultProfiles;
private String defaultMavenOpts;
@@ -69,6 +70,7 @@ private enum InvocationProperty
OFFLINE( "invoker.offline" ),
SYSTEM_PROPERTIES_FILE( "invoker.systemPropertiesFile" ),
DEBUG( "invoker.debug" ),
+ QUIET( "invoker.quiet" ),
SETTINGS_FILE( "invoker.settingsFile" ),
TIMEOUT_IN_SECONDS( "invoker.timeoutInSeconds" );
@@ -131,6 +133,15 @@ public void setDefaultDebug( boolean defaultDebug )
this.defaultDebug = defaultDebug;
}
+ /**
+ * Default value for quiet
+ * @param defaultQuiet a default value
+ */
+ public void setDefaultQuiet( boolean defaultQuiet )
+ {
+ this.defaultQuiet = defaultQuiet;
+ }
+
/**
* Default value for goals
* @param defaultGoals a default value
@@ -457,6 +468,10 @@ public void configureInvocation( InvocationRequest request, int index )
.map( Boolean::parseBoolean )
.orElse( defaultDebug ) );
+ setIfNotNull( request::setQuiet, get( InvocationProperty.QUIET, index )
+ .map( Boolean::parseBoolean )
+ .orElse( defaultQuiet ) );
+
setIfNotNull( request::setTimeoutInSeconds, get( InvocationProperty.TIMEOUT_IN_SECONDS, index )
.map( Integer::parseInt )
.orElse( defaultTimeoutInSeconds ) );
diff --git a/src/test/java/org/apache/maven/plugins/invoker/InvokerPropertiesTest.java b/src/test/java/org/apache/maven/plugins/invoker/InvokerPropertiesTest.java
index 1deeb116..a4142217 100644
--- a/src/test/java/org/apache/maven/plugins/invoker/InvokerPropertiesTest.java
+++ b/src/test/java/org/apache/maven/plugins/invoker/InvokerPropertiesTest.java
@@ -363,6 +363,38 @@ public void testConfigureRequestDebug()
clearInvocations( request );
}
+ @Test
+ public void testConfigureRequestQuiet()
+ {
+ Properties props = new Properties();
+ InvokerProperties facade = new InvokerProperties( props );
+
+ props.setProperty( "invoker.quiet", "true" );
+ facade.configureInvocation( request, 0 );
+ verify( request ).setQuiet( true );
+ verifyNoMoreInteractions( request );
+ clearInvocations( request );
+
+ props.setProperty( "invoker.quiet", "false" );
+ facade.configureInvocation( request, 0 );
+ verify( request ).setQuiet( false );
+ verifyNoMoreInteractions( request );
+
+ props.clear();
+
+ facade.setDefaultQuiet( true );
+ facade.configureInvocation( request, 0 );
+ verify( request ).setQuiet( true );
+ verifyNoMoreInteractions( request );
+ clearInvocations( request );
+
+ facade.setDefaultQuiet( false );
+ facade.configureInvocation( request, 0 );
+ verify( request ).setQuiet( false );
+ verifyNoMoreInteractions( request );
+ clearInvocations( request );
+ }
+
@Test
public void testConfigureRequestTimeoutInSeconds()
{