Skip to content

[mvnd-1.x] Honour an explicit false on a VOID command-line option - #1883

Open
arturobernalg wants to merge 2 commits into
apache:mvnd-1.xfrom
arturobernalg:fix/mvnd-1x-serial-false-backport
Open

arturobernalg wants to merge 2 commits into
apache:mvnd-1.xfrom
arturobernalg:fix/mvnd-1x-serial-false-backport

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Environment#getCommandLineOption always returned a non-null value for a VOID-type option (e.g. mvnd.serial) whenever any of its prefixes matched, regardless of what followed. -Dmvnd.serial=false and --serial=false were therefore indistinguishable from --serial, so an explicit "false" turned serial mode ON instead of leaving it off.

Inspect the text after the matched prefix and treat an explicit "false" (case-insensitive) as turning the option off.

Backport of the Environment.java part of #1855 from master, adapted to this branch: mvnd-1.x has since diverged (DefaultClient.java is split into java-mvnd/java-fallback source sets here, unlike master's single source set), so this backport is scoped to the independently reproducible and testable VOID-option bug. The other fixes bundled in #1855 (blank-argument handling, maven.config-aware threads/builder defaults, active-daemon log purge) touch the java-mvnd-only DefaultClient class, which this branch's test-compile classpath cannot resolve against (it resolves symbols against the java-fallback class instead), so they are left for a separate change.

Added EnvironmentTest#voidOptionHonoursExplicitFalse, which fails on the current code and passes with the fix. Full client+common suite: 15/15 tests green. Checkstyle: no new violations on the touched lines (the branch has pre-existing, unrelated violations elsewhere).


To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
check one of the following:

@slachiewicz slachiewicz added the bug Something isn't working label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants