Skip to content

SONARJAVA-6219 Remove --batch-mode mvn argument to log repox downloads#5542

Merged
tomasz-tylenda-sonarsource merged 1 commit intomasterfrom
tt/build-maven-args
Mar 31, 2026
Merged

SONARJAVA-6219 Remove --batch-mode mvn argument to log repox downloads#5542
tomasz-tylenda-sonarsource merged 1 commit intomasterfrom
tt/build-maven-args

Conversation

@tomasz-tylenda-sonarsource
Copy link
Copy Markdown
Contributor

No description provided.

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown
Contributor

hashicorp-vault-sonar-prod bot commented Mar 31, 2026

SONARJAVA-6219

@sonar-review-alpha
Copy link
Copy Markdown

sonar-review-alpha bot commented Mar 31, 2026

Summary

This PR removes the --batch-mode flag from Maven invocations in CI workflows and refactors output-related flags into a reusable environment variable. The --batch-mode flag disables buffering and suppresses verbose output, so removing it allows Maven to log repository downloads (e.g., from Repox) which may be useful for debugging or observability. The -e and -V short flags are consolidated into MAVEN_OUTPUT_ARGS env var (--errors --show-version) for consistency and maintainability across three build jobs (ruling, plugin, sanity).

What reviewers should know

The change is straightforward: verify that the new MAVEN_OUTPUT_ARGS env var is correctly applied to all three Maven commands (lines 100, 156, 198) and that each command still has the same net effect. Note that the short flags -B -e -V are being replaced by an env var containing the expanded forms --errors --show-version (removing -B entirely). Check the commit message or linked Jira issue (SONARJAVA-6219) for context on why suppressing batch mode helps with repository download logging.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conclusion: One real regression in the it-plugin job — the parallel execution parameters were silently dropped alongside the batch-mode flags, which will cause those tests to run sequentially.

🗣️ Give feedback

run: |
cd its/plugin
mvn package --batch-mode -Pit-plugin -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dmaven.test.redirectTestOutputToFile=false -B -e -V -Dparallel=classes -DuseUnlimitedThreads=true
mvn package ${MAVEN_OUTPUT_ARGS} -Pit-plugin -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dmaven.test.redirectTestOutputToFile=false
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old command included -Dparallel=classes -DuseUnlimitedThreads=true, but both were dropped here. This appears to be an unintentional side-effect of cleaning up the batch-mode flags — the ruling-qa job (line 101) kept its equivalent -Dparallel=methods -DuseUnlimitedThreads=true. Without these, plugin-qa tests run sequentially, which will likely significantly increase CI time.

Suggested change
mvn package ${MAVEN_OUTPUT_ARGS} -Pit-plugin -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dmaven.test.redirectTestOutputToFile=false
mvn package ${MAVEN_OUTPUT_ARGS} -Pit-plugin -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dmaven.test.redirectTestOutputToFile=false -Dparallel=classes -DuseUnlimitedThreads=true
  • Mark as noise

Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ✅

🗣️ Give feedback

@sonarqube-next
Copy link
Copy Markdown

@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource changed the title SONARJAVA-6219 Remove --batch-mode mvn argument to log repox download SONARJAVA-6219 Remove --batch-mode mvn argument to log repox downloads Mar 31, 2026
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the downloads from repox in the logs 👍

@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource merged commit 836733d into master Mar 31, 2026
30 of 31 checks passed
@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource deleted the tt/build-maven-args branch March 31, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants