Skip to content

Enable PathConflictResolver by default - #12662

Open
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:quick-fix/default-path-conflict-resolver
Open

Enable PathConflictResolver by default#12662
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:quick-fix/default-path-conflict-resolver

Conversation

@gnodet

@gnodet gnodet commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Switch the default conflict resolver from classic (O(N²)) to path (O(N)) via maven-user.properties
  • The PathConflictResolver has been available since resolver 2.0.11 and produces the same resolution results as ClassicConflictResolver
  • Users can revert with -Daether.conflictResolver.impl=classic

Benchmark Results

Tested on a 4383-module generated reactor project (Apple M4 Pro, JDK 21):

Conflict Resolver mvn clean install -DskipTests Speedup
classic (current default) 2:45 baseline
path 1:45 36% faster

The ClassicConflictResolver.gatherConflictItems() performs O(N×M) recursive DFS and accounts for 46.7% of total CPU on large reactor builds (measured via JFR profiling). The PathConflictResolver replaces this with an O(N) parallel path tree algorithm.

Test plan

  • Verified build compiles
  • Benchmarked on 4383-module project: 2:45 → 1:45 (36% reduction)
  • CI passes
  • Integration tests pass with path resolver

🤖 Generated with Claude Code

Switch the default conflict resolver from "classic" (O(N²)) to "path"
(O(N)) via maven-user.properties. Benchmarking on a 4383-module
generated reactor shows a 36% wall-time reduction for
`mvn clean install -DskipTests` (2:45 → 1:45 on Apple M4 Pro).

The PathConflictResolver has been available since resolver 2.0.11 and
produces the same resolution results as ClassicConflictResolver while
operating in O(N) time via a parallel path tree structure. Users can
revert to the classic resolver by setting
`-Daether.conflictResolver.impl=classic`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, low-risk performance improvement. Switching the default conflict resolver from classic (O(N²)) to path (O(N)) via a single properties file change is a solid approach.

The resolver version (2.0.20) is well above the 2.0.11 minimum when PathConflictResolver was introduced, and the fallback mechanism (-Daether.conflictResolver.impl=classic) provides an adequate escape hatch.

Minor observation: the comment on line 66 lists "auto (classic)" as an option — if "auto" is an internal alias, consider clarifying or dropping it to avoid user confusion.

CI is still pending — the existing conflict resolution integration tests should implicitly exercise the new default once it passes.

Note: Cannot submit as APPROVE because the PR author matches the review account.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

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