Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos/pipe
[#feature-sensible-default-maven-settings]
=== Sensible default Maven parameters

The Maven parameters that are useful on a build server, `--batch-mode` (`-B`) and `--no-transfer-progress` (`-ntp`) are enable by default, no need to add them in your mvn invocations.
The Maven parameters that are useful on a build server, `--batch-mode` (`-B`) is enable by default and transfer output is suppressed, no need to add them in your mvn invocations.

if **<<feature-traceability>>** is enabled, `--no-transfer-progress` (`-ntp`) option is removed, and `--show-version` (`-V`) is added.
if **<<feature-traceability>>** is enabled, `--show-version` (`-V`) is added and transfer output is enabled.

[#feature-maven-integration-global-settings]
=== Maven Settings Support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,13 @@ private void setupMaven(@NonNull Collection<Credentials> credentials) throws IOE
boolean isUnix = Boolean.TRUE.equals(getComputer().isUnix());
StringBuilder mavenConfig = new StringBuilder();
mavenConfig.append("--batch-mode ");
ifTraceabilityDisabled(() -> mavenConfig.append("--no-transfer-progress "));
ifTraceabilityDisabled(() -> {
// In batch-mode transfer output is sent through Slf4jMavenTransferListener
// Not using -ntp because it breaks maven <=3.6 which does not support the option
// Maven 4.0 supports CI=true to quite transfer output
mavenConfig.append(
"-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn ");
});
ifTraceabilityEnabled(() -> mavenConfig.append("--show-version "));
if (StringUtils.isNotEmpty(settingsFilePath)) {
// JENKINS-57324 escape '%' as '%%'. See
Expand Down