Conversation
gnodet
force-pushed
the
mng7131-regression-tests
branch
from
September 15, 2026 23:32
6d2ffd8 to
1c5eb34
Compare
gnodet-bot
approved these changes
Sep 17, 2026
gnodet-bot
left a comment
There was a problem hiding this comment.
Solid regression guard for MNG-7131. The two-layer approach (compat MavenCliTest + impl-level MavenParserTest) is exactly right: the compat test exercises the full initialize → cli → properties pipeline through a real on-disk fixture, while MavenParserTest directly unit-tests parseMavenConfigOptions with all the edge cases that matter.
Specific notes:
parseMavenConfigOptionsisprotectedinMavenParser, accessible from the same package — the test placement inorg.apache.maven.cling.invoker.mvnis correct.new MavenParser()instantiates via the default no-arg constructor (no CDI injection required at this level) — valid.- Five test cases cover: spaced-value two-line form (the regressed case), simple two-line form, compact
-Dform, comment/blank-line filtering, and goal rejection. Coverage is complete for the documented contract. testGoalRejectedcorrectly exercises theIllegalArgumentExceptionpath (commandLine.getArgList()returns["verify"],goals().isPresent()→ throws).- The compat fixture mirrors exactly the format that triggered the MNG-7131 fix: a comment line, two-line
--define/label=Apache Maven, two-line--define/revision=1.0.0. - No functional code is changed — pure test addition.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
maven.configuses a one-argument-per-line format (introduced by MNG-7131, commit331c5c3435, July 2021), modelled after Java@argfiles. Each line is a single argv token — whitespace inside a line is never re-split. This allows property values containing spaces:The two lines are passed as two separate tokens to Commons CLI, which consumes the second as the argument to
--define.PR #13093 (
2829a73de4) broke this contract by addingflatMap(line -> CleanArgument.splitLine(line).stream())inMavenParser.parseMavenConfigOptions, re-tokenizing each line on unquoted whitespace. It was reverted in #13148. There were no regression tests protecting this contract, so this PR adds them.Changes
compat/maven-embeddercompat/maven-embedder/src/test/projects/mavenConfigSpacedValues/.mvn/maven.configUses the
--define/value with spacestwo-line form for two properties.MavenCliTest#testMavenConfigMultiLineDefineWithSpaces()Calls
initialize→cli→propertiesand asserts both user properties are parsed correctly.impl/maven-cliMavenParserTest(same package asMavenParserforprotectedaccess)Five test cases covering:
testMultiLineDefineWithSpacedValue— core regression:--define/label=Apache Mavenmust yieldlabel=Apache Maven(the exact case Fix #13092: tokenize quoted --define in maven.config #13093 broke)testMultiLineDefineSimple— two-line form without spacestestSingleLineDefine— compact-Dkey=valueform still workstestCommentsAndEmptyLinesSkipped— comment/blank lines are filteredtestGoalRejected— goals throwIllegalArgumentExceptionTesting