Skip to content

Fix #327: evaluate model collections on Maven 4 - #417

Open
wilx wants to merge 2 commits into
apache:masterfrom
wilx:issue-327-maven-4
Open

Fix #327: evaluate model collections on Maven 4#417
wilx wants to merge 2 commits into
apache:masterfrom
wilx:issue-327-maven-4

Conversation

@wilx

@wilx wilx commented Aug 9, 2026

Copy link
Copy Markdown

Summary

Fixes #327 for the Maven 4-enabled line.

Maven 4 exposes evaluated model collections through WrapperList and 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 as AbstractList.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 WrapperList reflection error; the second applies the fix.

Validation

  • Maven 3.10.0-rc-1 / JDK 17 -Prun-its clean verify: all 26 unit tests and all 35 applicable ITs passed; the Maven 4-only regression IT was skipped
  • Maven 4.0.0-rc-6 / JDK 21 clean verify: all 26 unit tests passed
  • Maven 4.0.0-rc-6 / JDK 21 focused -Prun-its clean verify: passed
  • Maven 4.0.0-rc-6 / JDK 25 focused -Prun-its clean verify: passed
  • Maven 4.0.0-rc-6 / JDK 21 full clean verify: the new IT passed; two existing Describe ITs failed (describe-cmd-with-goal-report and describe-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 verify was 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.

@wilx
wilx marked this pull request as ready for review August 9, 2026 13:35
@slachiewicz slachiewicz added the bug Something isn't working label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MPH-210] Failure to evaluate on Maven 3.9 + JDK 21

2 participants