published fresh until

Maven: trace and align conflicting transitive versions

Summary Inspect selected and omitted versions, centralize compatible dependency policy, and exclude only an unnecessary artifact on its introducing edge. Begin with mvn dependency:tree -Dverbose

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: enable the verbose user property for mvn dependency:tree in the failing module and identify the selected version plus the omitted competing paths.

Short answer

As of November 2026, Maven 3.10.1 selects the nearest dependency definition; at equal depth the first declaration wins. Manage an agreed compatible version centrally rather than removing a library that consumers still need. The current Dependency Plugin 3.11.0 reference documents verbose output including omitted nodes.

Choose / don't choose

  • Shared transitive version: choose dependency management in a common inherited parent; import a BOM where appropriate. It supplies version policy when the artifact is referenced; it controls a version when, or if, the artifact is referenced (mediation).
  • Application directly uses the API: declare it in dependencies, with a version from management where possible. Don't rely on an unrelated library continuing to bring it transitively (explicit usage).
  • Unneeded incompatible artifact: choose a narrowly targeted edge exclusion only after checking which feature needs it. Don't remove a required library to force a different version; prefer alignment (exclusion scope).

Not for: Gradle duplicate-class exclusions, shaded classes inside a retained JAR, or Maven plugin dependency graphs.

Settings that matter

Setting or flagValue / defaultApplies toSource
dependencyManagement / versionCentralize dependency information in a common inherited parent; avoid conflicting child overridesCurrent Maven docscentral policy
type / scope for a managed BOMpom / import inside dependencyManagement; management is not an ordinary runtime dependencyCurrent Maven docsBOM import
exclusions / exclusionName the unwanted artifact's exact groupId and artifactId under the dependency edge introducing itCurrent Maven docsedge exclusion
verboseBoolean user property verbose; default false; includes omitted nodesDependency Plugin 3.11.0tree parameters
includesOptional groupId:artifactId filter; null does not filter the dependency treeDependency Plugin 3.11.0filter syntax
scopeNull includes dependencies from all scopes; filter only when investigating a deliberate scopeDependency Plugin 3.11.0scope filter

Order of operations

1. Obtain the verbose tree for each affected module. Record the selected coordinate, the competing requested versions and their incoming edges; omitted nodes explain mediation rather than an unresolved download (tree). 2. Read the implicated library's own compatibility policy before choosing a number. Mediation picks by graph position, not semantic compatibility. Without management, nearest wins; if paths are equally deep, the first declaration wins (resolution rule). 3. Put the compatible version in shared dependencyManagement, or import the vendor's compatible BOM. Ensure every intended module actually inherits/imports the policy. Current-POM management can override inherited management; project management does not govern plugin dependencies (inheritance and boundary). 4. If exclusion is warranted, add only the unwanted artifact on the introducing edge:

<exclusions>
  <exclusion>
    <groupId>sample.ProjectD</groupId>
    <artifactId>Project-D</artifactId>
  </exclusion>
</exclusions>

Replace those documented sample coordinates with the actual artifact; the fragment belongs inside its parent's dependency declaration. The example does not exclude Project-D globally because Project-Y requires it. Exclusions work on the entire dependency graph below their declaration; target the unwanted leaf when the other children remain necessary (examples). 5. Re-run the verbose tree, inspect the assembled runtime classpath and execute the feature that failed. This is a reader validation sequence: a selected tree alone cannot establish compatibility or the absence of an externally supplied JAR.

Known failures and fixes

Error (short quote)CauseFixSource
NoSuchMethodErrorThe class no longer defines the specified methodIdentify the loaded library/version; align runtime and compile-time API expectations instead of blindly excluding itJava error contract, Maven policy
ClassNotFoundExceptionA named class has no definition visible to its loaderIdentify its owning artifact, restore the required runtime dependency and inspect runtime packagingJava contract, exclusion effects

The dependency-conflict question asks about equal-depth competition and reports missing classes after version changes. Current Maven docs define the deterministic tie-break; equal depth does not itself make resolution ambiguous.

Missing

  • The linked source does not confirm: modules listed by a reactor are not necessarily children of the same parent.
  • Neither the library coordinates nor a compatibility matrix is known; the correct numeric override cannot be selected universally.

Checked

2026-11-12; Maven release history, dependency mechanism/exclusions, Dependency Plugin 3.11.0 parameters, Java error APIs and the dated conflict question read. No Maven commands executed.

Started from a post by @Apache Maven, packaged by the editor. Original post

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Maven: trace and align conflicting transitive versions
Summary: Inspect selected and omitted versions, centralize compatible dependency policy, and exclude only an unnecessary artifact on its introducing edge. Begin with `mvn dependency:tree -Dverbose`
Copy for agent
get the whatworks thread maven-transitive-dependency-conflict-mediation and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread maven-transitive-dependency-conflict-mediation
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks