Skip to content

Upgrade plugin dependencies (extra-enforcer-rules) in mvnup#12051

Merged
gnodet merged 1 commit into
masterfrom
ci-issue-extra-enforcer-rules
May 19, 2026
Merged

Upgrade plugin dependencies (extra-enforcer-rules) in mvnup#12051
gnodet merged 1 commit into
masterfrom
ci-issue-extra-enforcer-rules

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 13, 2026

Summary

  • Adds support for upgrading plugin dependencies (not just plugin versions) in mvnup
  • Specifically upgrades org.codehaus.mojo:extra-enforcer-rules to minimum version 1.4 for Maven 4 compatibility

Problem

extra-enforcer-rules versions before 1.4 use DependencyGraphBuilder.buildDependencyGraph(MavenProject, ArtifactFilter) — a method removed in Maven 4. This causes NoSuchMethodError at runtime when rules like BanCircularDependencies are executed.

Found during maven4-testing across ~960 Apache repositories (e.g., rocketmq uses extra-enforcer-rules:1.0-beta-4).

Version 1.4 switched to buildDependencyGraph(ProjectBuildingRequest, ArtifactFilter) which is compatible with Maven 4.

Changes

  • PluginUpgradeStrategy: Added PLUGIN_DEPENDENCY_UPGRADES list and upgradePluginDependencies() method that checks <dependencies> inside <plugin> elements
  • Reuses existing upgradePluginVersion() for version comparison and property handling
  • Added 2 tests for the new functionality

Test plan

  • Existing tests pass (19/19)
  • New tests pass (2 new, 21 total)
    • Upgrades extra-enforcer-rules:1.0-beta-4 to 1.4
    • Preserves extra-enforcer-rules:1.8.0 (already sufficient)

Claude Code on behalf of Guillaume Nodet

extra-enforcer-rules versions before 1.4 use DependencyGraphBuilder
.buildDependencyGraph(MavenProject, ArtifactFilter) which was removed
in Maven 4. The mvnup plugin upgrade strategy now also checks and
upgrades dependencies declared inside plugin configurations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gnodet gnodet force-pushed the ci-issue-extra-enforcer-rules branch from 7257a80 to 2729815 Compare May 19, 2026 10:04
@gnodet gnodet merged commit b375371 into master May 19, 2026
42 of 43 checks passed
@gnodet gnodet deleted the ci-issue-extra-enforcer-rules branch May 19, 2026 14:27
@github-actions
Copy link
Copy Markdown

@gnodet Please assign appropriate label to PR according to the type of change.

@github-actions github-actions Bot added this to the 4.1.0 milestone May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants