You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/10/19 13:33:51 UTC

(maven-dependency-plugin) branch master updated (f6fa2488 -> b830d5b0)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git


    from f6fa2488 Bump org.codehaus.plexus:plexus-archiver from 4.14.0 to 4.15.0
     new 64ba05df [MDEP-721] Document the verbose dependency:tree output
     new b830d5b0 [MDEP-721] Reword the scope not updated note

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/site/markdown/usage.md.vm | 96 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)


(maven-dependency-plugin) 01/02: [MDEP-721] Document the verbose dependency:tree output

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit 64ba05df2badb71113269b6ac8ac3801571f5e62
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Wed Oct 14 00:10:55 2026 +0200

    [MDEP-721] Document the verbose dependency:tree output
---
 src/site/markdown/usage.md.vm | 96 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/src/site/markdown/usage.md.vm b/src/site/markdown/usage.md.vm
index b1c50e7c..5bd49d17 100644
--- a/src/site/markdown/usage.md.vm
+++ b/src/site/markdown/usage.md.vm
@@ -530,6 +530,102 @@ Also, the `outputType` parameter can be used to generate different formats of ou
 mvn dependency:tree -DoutputFile=/path/to/file.graphml -DoutputType=graphml
 ```
 
+The `verbose` parameter explains the tree. By default the tree shows what Maven resolves: each artifact once, at the version and scope Maven selected. With `-Dverbose` the goal collects the dependencies again and also shows the nodes that Maven left out, and why:
+
+```
+mvn dependency:tree -Dverbose
+```
+
+For this project, whose `dependencyManagement` section sets `maven-model` to version `2.0.5` with scope `test`:
+
+```xml
+<dependencyManagement>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+      <version>2.0.5</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</dependencyManagement>
+
+<dependencies>
+  <dependency>
+    <groupId>org.apache.maven</groupId>
+    <artifactId>maven-project</artifactId>
+    <version>2.0.6</version>
+    <exclusions>
+      <exclusion>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-artifact</artifactId>
+      </exclusion>
+    </exclusions>
+  </dependency>
+  <dependency>
+    <groupId>org.apache.maven</groupId>
+    <artifactId>maven-profile</artifactId>
+    <version>2.0.4</version>
+    <scope>test</scope>
+  </dependency>
+  <dependency>
+    <groupId>org.apache.maven</groupId>
+    <artifactId>maven-model</artifactId>
+    <version>2.0.7</version>
+    <scope>runtime</scope>
+  </dependency>
+</dependencies>
+```
+
+the output is:
+
+```
+org.example:app:jar:1.0-SNAPSHOT
++- org.apache.maven:maven-project:jar:2.0.6:compile
+|  +- org.apache.maven:maven-settings:jar:2.0.6:compile
+|  |  +- (org.apache.maven:maven-model:jar:2.0.5:test - version managed from 2.0.6; scope managed from compile; omitted for conflict with 2.0.7)
+|  |  +- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
+|  |  \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for duplicate)
+|  +- (org.apache.maven:maven-profile:jar:2.0.6:compile - omitted for conflict with 2.0.4)
+|  +- (org.apache.maven:maven-model:jar:2.0.5:test - version managed from 2.0.6; scope managed from compile; omitted for conflict with 2.0.7)
+|  +- org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
+|  |  +- org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
+|  |  |  \- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
+|  |  +- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
+|  |  +- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for duplicate)
+|  |  \- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile
+|  |     \- (org.codehaus.plexus:plexus-utils:jar:1.0.4:compile - omitted for conflict with 1.4.1)
+|  +- org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
+|  |  +- (org.codehaus.plexus:plexus-utils:jar:1.4.1:compile - omitted for duplicate)
+|  |  \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile - omitted for duplicate)
+|  +- org.codehaus.plexus:plexus-utils:jar:1.4.1:compile
+|  \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
+|     +- junit:junit:jar:3.8.1:compile
+|     +- (org.codehaus.plexus:plexus-utils:jar:1.0.4:compile - omitted for conflict with 1.4.1)
+|     \- classworlds:classworlds:jar:1.1-alpha-2:compile
++- org.apache.maven:maven-profile:jar:2.0.4:test (scope not updated to compile)
+|  +- (org.apache.maven:maven-model:jar:2.0.5:test - version managed from 2.0.4; scope managed from compile; omitted for conflict with 2.0.7)
+|  +- (org.codehaus.plexus:plexus-utils:jar:1.1:test - omitted for conflict with 1.4.1)
+|  \- (org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9:test - omitted for conflict with 1.0-alpha-9-stable-1)
+\- org.apache.maven:maven-model:jar:2.0.7:runtime
+   \- (org.codehaus.plexus:plexus-utils:jar:1.4.1:runtime - omitted for duplicate)
+```
+
+A node in parentheses is omitted: Maven does not use it. The text after the dash says why:
+
+- `omitted for duplicate` means the same artifact and version appears elsewhere in the tree, closer to the root, and that node is the one in use. For example, `plexus-utils:1.4.1` below `maven-settings` is a repeat of the one directly below `maven-project`.
+- `omitted for conflict with <version>` means another version of the artifact is in use. Maven keeps the version of the node closest to the root, and the first one if they are equally close, so the node for `maven-model:2.0.7` below the root wins over the `2.0.5` that the other paths ask for. An artifact that often loses to another version is a candidate for a `dependencyManagement` entry or an exclusion.
+
+A node can also carry notes in parentheses after the artifact, without being omitted. A note does not change what the artifact is, it explains how it got there:
+
+- `version managed from <version>` means `dependencyManagement` replaced the version the dependency declared with the one shown. Maven 4 manages the dependencies of transitive dependencies as well, so with Maven 4 more nodes carry this note, some of them with the same version before and after.
+- `scope managed from <scope>` is the same for the scope. `maven-model:2.0.5:test` above was declared with scope `compile` and `dependencyManagement` set it to `test`.
+- `scope not updated to <scope>` means another path to the same artifact asked for a wider scope, here `compile` through `maven-project`, but the node shown keeps the scope it was declared with in the project, `test` for `maven-profile:2.0.4`.
+
+The notes combine with the omission: `version managed from 2.0.6; scope managed from compile; omitted for conflict with 2.0.7` is a node whose version and scope were managed, which then lost to another version.
+
+With `-DoutputType=json` and `-Dverbose`, each node also has `included`, `omittedReason`, `winnerVersion`, `versionManagedFrom`, `scopeManagedFrom` and `scopeNotUpdatedTo` members, where they apply; see [Dependency tree output formats](./examples/tree-mojo.html). The `includes` and `excludes` parameters filter the verbose tree as well.
+
 `dependency:build-classpath`
 ----------------------------
 


(maven-dependency-plugin) 02/02: [MDEP-721] Reword the scope not updated note

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit b830d5b03aba8ce4cb888099595904d2a89e65b9
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Wed Oct 14 00:32:52 2026 +0200

    [MDEP-721] Reword the scope not updated note
---
 src/site/markdown/usage.md.vm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/site/markdown/usage.md.vm b/src/site/markdown/usage.md.vm
index 5bd49d17..65719a8b 100644
--- a/src/site/markdown/usage.md.vm
+++ b/src/site/markdown/usage.md.vm
@@ -620,7 +620,7 @@ A node can also carry notes in parentheses after the artifact, without being omi
 
 - `version managed from <version>` means `dependencyManagement` replaced the version the dependency declared with the one shown. Maven 4 manages the dependencies of transitive dependencies as well, so with Maven 4 more nodes carry this note, some of them with the same version before and after.
 - `scope managed from <scope>` is the same for the scope. `maven-model:2.0.5:test` above was declared with scope `compile` and `dependencyManagement` set it to `test`.
-- `scope not updated to <scope>` means another path to the same artifact asked for a wider scope, here `compile` through `maven-project`, but the node shown keeps the scope it was declared with in the project, `test` for `maven-profile:2.0.4`.
+- `scope not updated to <scope>` means another path to the same artifact asked for a wider scope, here `compile` through `maven-project`, but the node shown keeps its own scope. A direct dependency keeps the scope the project declares, `test` for `maven-profile:2.0.4`, and a `system` scope is never widened.
 
 The notes combine with the omission: `version managed from 2.0.6; scope managed from compile; omitted for conflict with 2.0.7` is a node whose version and scope were managed, which then lost to another version.