Fix #327: evaluate model collections on Maven 4 - #417
Open
wilx wants to merge 2 commits into
Open
Conversation
wilx
marked this pull request as ready for review
August 9, 2026 13:35
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.
Summary
Fixes #327 for the Maven 4-enabled line.
Maven 4 exposes evaluated model collections through
WrapperListand uses immutable collection and map implementations inside the model. XStream does not recognize these implementations and falls back to reflective serialization, which fails when it tries to access JDK internals such asAbstractList.modCount.This change registers collection and map converters that accept their public interfaces and aliases the concrete runtime list class so the existing XML root name is preserved. The evaluated list is serialized directly without copying it.
The commits are intentionally split: the first adds the regression IT and fails with the
WrapperListreflection error; the second applies the fix.Validation
-Prun-its clean verify: all 26 unit tests and all 35 applicable ITs passed; the Maven 4-only regression IT was skippedclean verify: all 26 unit tests passed-Prun-its clean verify: passed-Prun-its clean verify: passedclean verify: the new IT passed; two existing Describe ITs failed (describe-cmd-with-goal-reportanddescribe-plugin-without-name)Checklist
This pull request addresses one issue without unrelated changes.
The description explains what changed, how, and why.
Each commit has a meaningful subject line and body. Commit subjects are meaningful; no commit bodies were added.
A regression integration test fails without the runtime change.
mvn verifywas run successfully.The complete Maven 3 integration-test suite and the focused Maven 4 regression IT were run successfully; unrelated full-suite RC6 failures are documented above.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004.
In any other case, an Apache Individual Contributor License Agreement has been filed.