mvnup: skip dedup inside plugin <configuration> elements - #12582
Merged
Conversation
gnodet
force-pushed
the
fix/mvnup-dedup-configuration
branch
from
July 29, 2026 12:36
c709d0c to
2751d09
Compare
Move the plugin POM to src/test/resources-filtered/ (which already
has <filtering>true</filtering> in the core-it-suite build) and
replace the hardcoded version with ${maven-version}, defined in the
ITs parent POM.
Maven resource filtering resolves the token at build time, so the
version always matches the Maven build under test — including during
the release process, where the release plugin bumps the version.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The DuplicateElementStrategy removes duplicate XML elements using last-wins semantics to satisfy Maven 4's stricter POM parser. However, it was also deduplicating inside plugin <configuration> sections, where the XML schema is free-form and plugin-specific. This broke builds that use repeated same-named elements as list entries (e.g. multiple <arg> in <compilerArgs>, multiple <module> in checkstyle config, multiple <exclude> in RAT config). The tool kept only the last occurrence of each tag name, silently dropping valid configuration. Fix: skip deduplication entirely when inside a <configuration> element. These sections contain plugin-specific XML whose schema is unknown to mvnup — treating same-named children as duplicates is incorrect. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet
force-pushed
the
fix/mvnup-dedup-configuration
branch
from
July 29, 2026 13:58
2751d09 to
246c9c8
Compare
gnodet
marked this pull request as ready for review
July 29, 2026 15:18
3 tasks
|
@gnodet Please assign appropriate label to PR according to the type of change. |
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
mvnup apply'sDuplicateElementStrategyincorrectly removes elements from plugin<configuration>sections, breaking builds of projects like Apache Accumulo.<arg>children inside<compilerArgs>, it keeps only the last one<arg>-Xlint:all</arg> <arg>-Xlint:-processing</arg> <arg>-Xmaxwarns</arg> <arg>5</arg>into just<arg>5</arg>, causingerror: invalid flag: 5<configuration>boundaries — POM schema elements above it are still deduplicated, but free-form plugin XML below it is left untouchedReproduction
Test plan
mvnup applyon accumulo-access produces zero POM modifications and build succeeds🤖 Generated with Claude Code