Why the depenencies are not marked as omitted in dependency tree

Hi guys,

I’m confused with the omit marker (i.e., the asterisk sign). Here is an example:

build.gradle

repositories {
    mavenCentral()
    maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
}

dependencies {
    implementation 'org.opensaml:opensaml-core:4.1.0'
}

Dependency tree:

compileClasspath - Compile classpath for source set 'main'.
\--- org.opensaml:opensaml-core:4.1.0
     +--- commons-codec:commons-codec:1.15
     +--- com.google.code.findbugs:jsr305:3.0.2
     +--- com.google.guava:guava:30.1-jre
     |    +--- com.google.guava:failureaccess:1.0.1
     |    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
     |    +--- com.google.code.findbugs:jsr305:3.0.2
     |    +--- org.checkerframework:checker-qual:3.5.0
     |    +--- com.google.errorprone:error_prone_annotations:2.3.4
     |    \--- com.google.j2objc:j2objc-annotations:1.3
     +--- io.dropwizard.metrics:metrics-core:4.1.18
     |    \--- org.slf4j:slf4j-api:1.7.30
     +--- org.slf4j:slf4j-api:1.7.30
     \--- net.shibboleth.utilities:java-support:8.2.0
          +--- org.slf4j:slf4j-api:1.7.30
          +--- commons-codec:commons-codec:1.15
          +--- com.google.code.findbugs:jsr305:3.0.2
          \--- com.google.guava:guava:30.1-jre (*)

Question:

Why org.slf4j:slf4j-api:1.7.30 is not marked as omitted, while the last com.google.guava:guava:30.1-jre is marked as omitted?

I think I got the point of (*) and had a better understanding of the official documentation regarding the asterisk.

Dependencies with the same coordinates that can occur multiple times in the graph are omitted and indicated by an asterisk.

Gradle will add the asterisk sign only when a dependency has its own dependencies and the dependency has appeared previously. So that its own dependencies won’t appear multi times.

For this case, com.google.guava:guava:30.1-jre has its own dependencies, while org.slf4j:slf4j-api:1.7.30 doesn’t. So only the former is marked by the asterisk sign.

2 Likes