Skip to content

Keep the declared dependency order when merging POMs - #1042

Merged
slachiewicz merged 1 commit into
masterfrom
agent/fix-archetype
Oct 1, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/fix-archetype

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

DefaultPomManager collected the generated POM's dependencies in a HashMap and added them to the existing POM by iterating it, so they were written in hash order rather than the order they were declared in. A LinkedHashMap keeps the declared order.

Found while porting to the Maven 4 API; part of apache/maven#13309.

Verified: the new testMergePomsKeepsDeclaredDependencyOrder fails without the fix ([alpha, zulu, yankee, …] instead of [zulu, alpha, mike, …]).

@slachiewicz slachiewicz added the bug Something isn't working label Sep 30, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 30, 2026 21:38
@slachiewicz
slachiewicz merged commit ff85ab9 into master Oct 1, 2026
21 checks passed
@slachiewicz
slachiewicz deleted the agent/fix-archetype branch October 1, 2026 19:18
@github-actions github-actions Bot added this to the 3.4.2 milestone Oct 1, 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.

1 participant