File tree Expand file tree Collapse file tree 5 files changed +47
-0
lines changed
main/java/org/apache/maven/shared/invoker
test/java/org/apache/maven/shared/invoker Expand file tree Collapse file tree 5 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ public class DefaultInvocationRequest
111111
112112 private File mavenExecutable ;
113113
114+ private boolean noTransferProgress ;
115+
114116 /**
115117 * <p>getBaseDirectory.</p>
116118 *
@@ -729,6 +731,19 @@ public InvocationRequest setQuiet( boolean quiet )
729731 return this ;
730732 }
731733
734+ @ Override
735+ public boolean isNoTransferProgress ()
736+ {
737+ return noTransferProgress ;
738+ }
739+
740+ @ Override
741+ public InvocationRequest setNoTransferProgress ( boolean noTransferProgress )
742+ {
743+ this .noTransferProgress = noTransferProgress ;
744+ return this ;
745+ }
746+
732747 /**
733748 * {@inheritDoc}
734749 */
Original file line number Diff line number Diff line change @@ -319,6 +319,14 @@ public interface InvocationRequest
319319 */
320320 boolean isQuiet ();
321321
322+ /**
323+ * Get the value of the {@code no-transfer-progress} argument.
324+ *
325+ * @return {@code true} if the argument {@code no-transfer-progress} was specified, otherwise {@code false}
326+ * @since 3.2.0
327+ */
328+ boolean isNoTransferProgress ();
329+
322330 // ----------------------------------------------------------------------
323331 // Reactor Failure Mode
324332 // ----------------------------------------------------------------------
@@ -736,6 +744,14 @@ enum CheckSumPolicy
736744 */
737745 InvocationRequest setQuiet ( boolean quiet );
738746
747+ /**
748+ * Enable no transfer progress mode. Equivalent of {@code -ntp} or {@code --no-transfer-progress}
749+ * @param noTransferProgress enable no transfer progress mode
750+ * @return This invocation request.
751+ * @since 3.2.0
752+ */
753+ InvocationRequest setNoTransferProgress ( boolean noTransferProgress );
754+
739755 /**
740756 * Get the current set builder strategy id equivalent of {@code --builder id}. <b>Note. This is available since
741757 * Maven 3.2.1</b>
Original file line number Diff line number Diff line change @@ -528,6 +528,11 @@ else if ( CheckSumPolicy.Warn.equals( checksumPolicy ) )
528528 {
529529 cli .createArg ().setValue ( "-q" );
530530 }
531+
532+ if ( request .isNoTransferProgress () )
533+ {
534+ cli .createArg ().setValue ( "-ntp" );
535+ }
531536 }
532537
533538 /**
Original file line number Diff line number Diff line change @@ -78,8 +78,12 @@ ${project.name}
7878 * Update-Snapshots Flag
7979
8080 * Debug Flag (show debug-level output)
81+
82+ * Quiet Flag (only show errors)
8183
8284 * Show-Errors Flag (show exception stacktraces, but not full debug output)
85+
86+ * No-Transfer-Progress Flag (Do not display transfer progress when downloading or uploading)
8387
8488 * Inherit-Shell-Environment Flag (inherit envars from the shell used to
8589 start the current JVM)
Original file line number Diff line number Diff line change @@ -485,6 +485,13 @@ public void testShouldUseDefaultOfFailFastWhenSpecifiedInRequest()
485485 assertArgumentsNotPresent ( cli , banned );
486486 }
487487
488+ @ Test
489+ public void testShouldSetNoTransferProgressFlagFromRequest ()
490+ {
491+ mclb .setFlags ( newRequest ().setNoTransferProgress ( true ), cli );
492+ assertArgumentsPresent ( cli , Collections .singleton ( "-ntp" ));
493+ }
494+
488495 @ Test
489496 public void testShouldSpecifyFileOptionUsingNonStandardPomFileLocation ()
490497 throws Exception
You can’t perform that action at this time.
0 commit comments