Skip to content

Read a parent plugin declared in several profiles once - #1494

Merged
slachiewicz merged 1 commit into
masterfrom
agent/duplicate-plugin-in-profiles
Nov 14, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/duplicate-plugin-in-profiles

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Fixes #1490, a regression in 2.25.1.

Since #1488 treats a parent plugin without <inherited> as inherited, a report plugin declared in two profiles of a parent POM reaches Collectors.toMap twice, and display-plugin-updates fails with "Duplicate key ... (attempted merging values 3.6.0 and 3.6.0)". The last declaration now wins, as it already does for build plugins and plugin management; the build-plugin reader gets the same merge function. The new IT declares one report plugin in two profiles of the parent.

Verified: display-plugin-updates on the reporter's versions-maven-plugin-2.25.1-regression branch โ†’ 2.25.1 fails with the duplicate key, this branch succeeds.

Since parent plugins without <inherited> count as inherited (#1488), a report plugin declared in two profiles of a parent reached Collectors.toMap twice and failed with a duplicate key. The last declaration wins, as it already does for build plugins and plugin management.
@slachiewicz slachiewicz added the bug Something isn't working label Nov 14, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 14, 2026 10:14
@slachiewicz
slachiewicz merged commit 531a774 into master Nov 14, 2026
16 checks passed
@slachiewicz
slachiewicz deleted the agent/duplicate-plugin-in-profiles branch November 14, 2026 10:23
@github-actions github-actions Bot added this to the 2.25.2 milestone Nov 14, 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.

org.codehaus.mojo:versions-maven-plugin:2.25.1 fails with plugin version declared more than once in profiles

1 participant