Skip to content

Fix #327: evaluate merged model lists on Maven 3 - #416

Open
wilx wants to merge 2 commits into
apache:maven-help-plugin-3.4.xfrom
wilx:issue-327-maven-3
Open

Fix #327: evaluate merged model lists on Maven 3#416
wilx wants to merge 2 commits into
apache:maven-help-plugin-3.4.xfrom
wilx:issue-327-maven-3

Conversation

@wilx

@wilx wilx commented Aug 9, 2026

Copy link
Copy Markdown

Summary

Fixes #327 for the Maven 3 maintenance line.

help:evaluate can receive model collections implemented by Maven's internal ModelMerger.MergingList. XStream does not recognize that implementation as a collection and falls back to reflective serialization, which fails when it tries to access AbstractList.modCount on recent JDKs.

This change registers a collection converter that accepts every Collection implementation 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 reflection error; the second applies the fix.

Validation

  • Maven 3.10.0-rc-1 / JDK 17 clean verify: all 22 unit tests passed
  • Maven 3.9.16 / JDK 21 -Prun-its clean verify: all 22 unit tests and all 35 ITs passed
  • Maven 3.10.0-rc-1 / JDK 17 -Prun-its clean verify: the regression IT passed; 34 of 35 ITs passed, with the unrelated existing describe-cmd assertion failing because the deploy lifecycle mapping was reported as undefined

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 integration-test suite was run successfully with Maven 3.9.16; the Maven 3.10.0-rc-1 boundary is 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
@wilx

wilx commented Aug 10, 2026

Copy link
Copy Markdown
Author

It looks like #419 is needed for the tests to pass.

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.

2 participants