Merged upstreamCorrectnessMerged Aug 1, 2026
Fix Maven fail-mode option parsing for -fae
Fixed mvnd's Maven file-option detection so fail-mode flags like -fae are no longer mistaken for -f with an attached path value.
apache/maven-mvnd · #1684
Problem
mvnd parsed Maven's compact fail-mode flags such as -fae, -ff, and -fn through its MAVEN_FILE option detection path. That could corrupt working-directory or base-path values for plugin goals, even though the equivalent Maven CLI and mvnd long-form flags behaved correctly.
Approach
Scoped the -f/--file matching logic so known Maven fail-mode short options are left for Maven's own parser, while preserving the supported -f, -f=, -f value, and --file forms.
Impact and scope
- Restores Maven-compatible behavior for users moving from mvn to mvnd with standard fail-mode flags.
- Prevents path corruption in plugin executions that depend on correct project base directories.
- Keeps mvnd's client-side option extraction precise without broadening the command-line parser surface.
Validation
- Added EnvironmentTest coverage that reproduces the -fae regression and covers -ff and -fn conflict cases.
- Preserved positive coverage for supported -f and --file option forms.
- Merged after maintainer approval with focused client and common module test commands documented in the PR.