Reputation: 1750
If we consider the following example, what is the difference between "+-" and "\-" symbols and what do they signify?
[INFO] [dependency:tree]
[INFO] org.apache.maven.plugins:maven-dependency-plugin:maven-plugin:2.0-alpha-5-SNAPSHOT
[INFO] +- org.apache.maven.reporting:maven-reporting-impl:jar:2.0.4:compile
[INFO] | \- commons-validator:commons-validator:jar:1.2.0:compile
[INFO] | \- commons-digester:commons-digester:jar:1.6:compile
[INFO] | \- (commons-collections:commons-collections:jar:2.1:compile - omitted for conflict with 2.0)
[INFO] \- org.apache.maven.doxia:doxia-site-renderer:jar:1.0-alpha-8:compile
[INFO] \- org.codehaus.plexus:plexus-velocity:jar:1.1.3:compile
[INFO] \- commons-collections:commons-collections:jar:2.0:compile
Upvotes: 42
Views: 18245
Reputation: 164
Maybe "+-" means the non-last node in the tree hierarchy
"\-" means the last node in the tree hierarchy
I guess that he may use some kind of data structure whose tail is an index.
for example
root:
....+-(first chirld)
....+-(second chirld)
........\-(last chirld)
....\-(last chirld)
Here's a more complex output about [maven-dependency-tree][https://github.com/apache/maven-dependency-tree] dependency:
[INFO] Scanning for projects...
[INFO]
[INFO] -----------< org.apache.maven.shared:maven-dependency-tree >------------
[INFO] Building Apache Maven Dependency Tree 3.1.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ maven-dependency-tree ---
[INFO] org.apache.maven.shared:maven-dependency-tree:jar:3.1.1-SNAPSHOT
[INFO] +- org.apache.maven:maven-core:jar:3.0.5:compile
[INFO] | +- org.apache.maven:maven-model:jar:3.0.5:compile
[INFO] | +- org.apache.maven:maven-settings:jar:3.0.5:compile
[INFO] | +- org.apache.maven:maven-settings-builder:jar:3.0.5:compile
[INFO] | +- org.apache.maven:maven-repository-metadata:jar:3.0.5:compile
[INFO] | +- org.apache.maven:maven-artifact:jar:3.0.5:compile
[INFO] | +- org.apache.maven:maven-plugin-api:jar:3.0.5:compile
[INFO] | +- org.apache.maven:maven-model-builder:jar:3.0.5:compile
[INFO] | +- org.apache.maven:maven-aether-provider:jar:3.0.5:compile
[INFO] | | \- org.sonatype.aether:aether-spi:jar:1.13.1:compile
[INFO] | +- org.sonatype.aether:aether-impl:jar:1.13.1:compile
[INFO] | +- org.sonatype.aether:aether-util:jar:1.13.1:compile
[INFO] | +- org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile
[INFO] | | \- org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile
[INFO] | | \- org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
[INFO] | | \- org.sonatype.sisu:sisu-guava:jar:0.9.9:compile
[INFO] | +- org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
[INFO] | +- org.codehaus.plexus:plexus-utils:jar:2.0.6:compile
[INFO] | +- org.codehaus.plexus:plexus-classworlds:jar:2.4:compile
[INFO] | \- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[INFO] | \- org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[INFO] +- org.codehaus.plexus:plexus-component-annotations:jar:2.0.0:compile (optional)
[INFO] +- org.sonatype.aether:aether-api:jar:1.13.1:compile (optional)
[INFO] +- org.eclipse.aether:aether-api:jar:1.1.0:compile (optional)
[INFO] \- org.eclipse.aether:aether-util:jar:1.1.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.519 s
[INFO] Finished at: 2021-12-27T16:06:44+08:00
[INFO] ------------------------------------------------------------------------
Upvotes: 1
Reputation: 193
For multiple dependencies on the same level, \-
will be shown for the last dependency at that level and +-
will be shown for all the other dependencies at that level.
Upvotes: 1
Reputation: 137184
Those symbols do not have any meaning whatsoever, they are just present to read the output of the tree better!
Here's a more complex output to see better what it does, on a spring-webmvc
dependency:
[INFO] +- org.springframework:spring-webmvc:jar:4.2.2.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.2.2.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.2.2.RELEASE:compile
[INFO] | | \- org.springframework:spring-aop:jar:4.2.2.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-core:jar:4.2.2.RELEASE:compile
[INFO] | | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] | +- org.springframework:spring-expression:jar:4.2.2.RELEASE:compile
Consider the dependency tree as levels: the first level correspond to the direct dependencies; the second level corresponds to the transitive dependencies of those direct dependencies, etc.
Basically, if there is more than one dependency on the same level for the same artifact, a +-
will be shown, otherwise a \-
will be shown, indicating an "end" of the tree (i.e. a path leading to a leaf).
Upvotes: 52
Reputation: 27852
The plus symbol indicates several nodes on the same level, while the -
symbol indicates one single node for that level of hierarchy.
Hence, in your case, maven-dependency-plugin
(+
symbol) has as transitive dependencies maven-reporting-impl
and doxia-site-renderer
at first level, then maven-reporting-impl
only has (-
symbol) commons-validator
as direct transitive dependency and so on.
Upvotes: 8
Reputation: 341
The \-
symbol indicates that this node is the last sibling listed for the current parent
Upvotes: 34