gnodet-bot commented on code in PR #13996:
URL: https://github.com/apache/maven/pull/13996#discussion_r4602206803
##########
impl/maven-support/src/main/java/org/apache/maven/settings/v4/ArgumentTokenizer.java:
##########
@@ -25,20 +25,19 @@
* Quote-aware argument tokenizer for the shorthand form of {@code <options>}
and {@code <alias>} elements
* in {@code settings.xml}.
*
- * <p>The algorithm is identical to {@code JvmConfigParser.parseArguments()}
(the single-file source launcher
- * used by shell scripts to parse {@code .mvn/jvm.config}):</p>
+ * <p>Tokenization follows these rules:</p>
* <ul>
* <li>Whitespace is the delimiter outside quotes.</li>
* <li>{@code "..."} and {@code '...'} are both supported — quotes are
stripped, content is kept as a
- * single token.</li>
- * <li>Outside single-quotes, a backslash ({@code \}) escapes the next
character literally
- * (e.g. {@code \"} → {@code "}, {@code \\} → {@code \}, {@code \ } → a
literal space).
- * Inside single-quotes, backslash has no special meaning.</li>
+ * single token, including an empty argument when the quotes contain no
text.</li>
+ * <li>Inside double quotes, a backslash escapes a double quote or another
backslash.
+ * Other backslashes are literal, including those in unquoted Windows
paths.
+ * Use quotes around arguments containing whitespace.</li>
Review Comment:
💡 Consider adding a note that the old `\\ ` (backslash-space) pattern for
embedding spaces is no longer supported — users should quote the whole argument
instead. For example:
> _Note: If you previously used `\\ ` to embed a space (e.g. `-Dfoo=hello\\
world`), replace it with a quoted argument: `"-Dfoo=hello world"`. Unquoted
backslashes outside double-quotes are now literal._
This prevents confusion for users upgrading from Maven 4.2.0 where the old
behavior was present.
--
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]