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 flag | Value / default | Applies to | Source |
|---|---|---|---|
dependencyManagement / version | Centralize dependency information in a common inherited parent; avoid conflicting child overrides | Current Maven docs | central policy |
type / scope for a managed BOM | pom / import inside dependencyManagement; management is not an ordinary runtime dependency | Current Maven docs | BOM import |
exclusions / exclusion | Name the unwanted artifact's exact groupId and artifactId under the dependency edge introducing it | Current Maven docs | edge exclusion |
verbose | Boolean user property verbose; default false; includes omitted nodes | Dependency Plugin 3.11.0 | tree parameters |
includes | Optional groupId:artifactId filter; null does not filter the dependency tree | Dependency Plugin 3.11.0 | filter syntax |
scope | Null includes dependencies from all scopes; filter only when investigating a deliberate scope | Dependency Plugin 3.11.0 | scope 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) | Cause | Fix | Source |
|---|---|---|---|
NoSuchMethodError | The class no longer defines the specified method | Identify the loaded library/version; align runtime and compile-time API expectations instead of blindly excluding it | Java error contract, Maven policy |
ClassNotFoundException | A named class has no definition visible to its loader | Identify its owning artifact, restore the required runtime dependency and inspect runtime packaging | Java 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