feat: suppress Maven transfer progress via MAVEN_ARGS by default (add show-download-progress input)#1053
Open
brunoborges wants to merge 3 commits into
Open
feat: suppress Maven transfer progress via MAVEN_ARGS by default (add show-download-progress input)#1053brunoborges wants to merge 3 commits into
brunoborges wants to merge 3 commits into
Conversation
Set MAVEN_ARGS to include -ntp (--no-transfer-progress) so Maven invocations in the job produce cleaner CI logs without download/transfer progress noise. Add a new optional 'show-download-progress' input (default false); set it to true to keep the progress output. The change preserves any existing MAVEN_ARGS value (the flag is appended, not overwritten) and is idempotent (it won't add the flag twice if -ntp or --no-transfer-progress is already present). Applies on all platforms; honored by Maven 3.9.0+ and the Maven Wrapper, and is a no-op for non-Maven builds. - action.yml: add show-download-progress input - src/constants.ts: add input + MAVEN_ARGS constants - src/maven-args.ts: new configureMavenArgs() - src/setup-java.ts: invoke configureMavenArgs() during setup - __tests__/maven-args.test.ts: unit tests - docs/advanced-usage.md: document the behavior and input - dist: rebuild bundled action Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces CI log noise for Maven builds by defaulting Maven to “no transfer progress” output via MAVEN_ARGS, while adding an input to opt back into showing download/transfer progress.
Changes:
- Add
show-download-progressinput (defaultfalse) and wire it into setup. - Introduce
configureMavenArgs()to append-ntptoMAVEN_ARGS(preserving existing values and avoiding duplicates). - Add unit tests and documentation describing the new default and opt-in behavior.
Show a summary per file
| File | Description |
|---|---|
action.yml |
Adds the show-download-progress input with a default of false. |
src/constants.ts |
Defines the new input name and Maven-related constants (MAVEN_ARGS, -ntp, --no-transfer-progress). |
src/maven-args.ts |
Implements the MAVEN_ARGS configuration/idempotency logic. |
src/setup-java.ts |
Invokes Maven args configuration during setup. |
__tests__/maven-args.test.ts |
Adds unit coverage for defaults, opt-in behavior, preservation, and idempotency. |
docs/advanced-usage.md |
Documents the new default behavior and the opt-in input. |
dist/setup/index.js |
Rebuild output including the new logic/constants. |
dist/cleanup/index.js |
Rebuild output including updated constants exports. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/8 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
By default, Maven logs a line for every artifact it downloads, which adds significant noise to CI logs. This PR makes
setup-javaset theMAVEN_ARGSenvironment variable to include-ntp(--no-transfer-progress) so that Maven invocations in the job produce cleaner, smaller logs — without needing to add-ntpto everymvncommand.A new optional input lets users opt back into the progress output.
Behavior
show-download-progress: false): the action exportsMAVEN_ARGSwith-ntpappended.MAVEN_ARGSvalue is preserved (the flag is appended, not overwritten).MAVEN_ARGSalready contains-ntpor--no-transfer-progress.show-download-progress: true):MAVEN_ARGSis left untouched, preserving Maven's default progress output and any user-provided value.MAVEN_ARGSis honored by Maven 3.9.0+ and the Maven Wrapper; older Maven versions ignore it (no-op). It has no effect on non-Maven builds (Gradle, sbt, etc.).Example
Changes
action.yml: addshow-download-progressinput (defaultfalse).src/constants.ts: add the input name andMAVEN_ARGS/ flag constants.src/maven-args.ts: newconfigureMavenArgs()implementing the logic above.src/setup-java.ts: invokeconfigureMavenArgs()during setup.__tests__/maven-args.test.ts: unit tests (default, opt-in, existing-value preservation, idempotency for both flag spellings).docs/advanced-usage.md: new "Maven transfer progress" section + TOC entry.dist/: rebuild bundled action.Notes
<interactiveMode>false</interactiveMode>(batch mode), which does not control progress output. See the discussion on feat: Disable interactiveMode in generated Maven settings.xml #1052.Check list