gnodet commented on issue #13092:
URL: https://github.com/apache/maven/issues/13092#issuecomment-5688711142

   PR #13093 has been reverted in #13148 because it introduces a regression.
   
   **Background**: [MNG-7131](https://issues.apache.org/jira/browse/MNG-7131) 
(July 2021, commit 
[331c5c3](https://github.com/apache/maven/commit/331c5c3435cdfa8dc3f35a7b38503bdac2654206))
 deliberately changed `maven.config` parsing from splitting on all whitespace 
to a **one-argument-per-line** model, specifically to allow values containing 
spaces. The commit message explicitly references Java `@argfiles` and Python 
argparse as precedents for this format.
   
   **The regression**: #13093 applied `CleanArgument.splitLine()` via `flatMap` 
over every line, which re-tokenizes on whitespace even lines that are 
standalone values. So the multi-line form that MNG-7131 introduced as the 
canonical workaround for this exact problem:
   
   ```
   --define
   key=value with spaces
   ```
   
   now fails with `"Unrecognized entries in maven.config"` because `"key=value 
with spaces"` is split into three tokens.
   
   **Existing workaround** (works today, before and after the revert): put the 
option and its value on separate lines:
   
   ```
   --define
   revision=1.0-SNAPSHOT
   ```
   
   Commons CLI handles `["--define", "revision=1.0-SNAPSHOT"]` as two argv 
tokens correctly — the option consumes the next token as its argument. This 
works for any value, including values with spaces (since the value line is 
passed as a single token).
   
   For a proper fix, the new tokenizer would need to only apply to lines that 
start with `-` (i.e. option lines), leaving value-only lines untouched — or the 
format needs a clearer specification before the parsing strategy is changed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to