Skip to content

Failures during dependency resolution seem to be swallowed #140

@sschuberth

Description

@sschuberth

I'm not sure whether it's supposed to be like that, but what I see it that running ./gradlew dependencies on https://github.com/wkl3nk/demo-7 gives

dependencySources
+--- org.jetbrains.kotlin:kotlin-stdlib:2.0.0
+--- org.projectlombok:lombok -> 1.18.32
+--- org.springframework.boot:spring-boot-starter-security -> 3.3.0
+--- org.springframework.boot:spring-boot-starter-web -> 3.3.0
+--- com.fasterxml.jackson.module:jackson-module-kotlin FAILED
\--- org.jetbrains.kotlin:kotlin-reflect:2.0.0
     \--- org.jetbrains.kotlin:kotlin-stdlib:2.0.0

So there is a resolution failure in jackson-module-kotlin and inspecting that further with ./gradlew dependencyInsight --dependency jackson-module-kotlin --configuration dependencySources gives:

> Task :dependencyInsight
com.fasterxml.jackson.module:jackson-module-kotlin: (selected by rule) FAILED
   Failures:
      - Could not resolve com.fasterxml.jackson.module:jackson-module-kotlin.
        No matching variant errors are explained in more detail at https://docs.gradle.org/8.8/userguide/variant_model.html#sub:variant-no-match.
          - No matching variant of com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1 was found. The consumer was configured to find sources for use during runtime, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
              - Variant 'apiElements' declares a component, packaged as a jar, and its dependencies declared externally:
                  - Incompatible because this component declares a library for use during compile-time and the consumer needed documentation for use during runtime
                  - Other compatible attributes:
                      - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                      - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')
                      - Doesn't say anything about the documentation type (required sources)
              - Variant 'runtimeElements' declares a component for use during runtime, packaged as a jar, and its dependencies declared externally:
                  - Incompatible because this component declares a library and the consumer needed documentation
                  - Other compatible attributes:
                      - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                      - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')
                      - Doesn't say anything about the documentation type (required sources)

However, when running this plugin's ForceDependencyResolutionPlugin_resolveAllDependencies on that project, dependency-graph.json is created just fine without any issues, but jackson-module-kotlin is simply omitted from the dependencySources configuration.

So my questions are:

  • Is there actually a (configuration) issue in that project?
    • If there is an issue in the project, why does ForceDependencyResolutionPlugin_resolveAllDependencies no report it as part of dependency-graph.json?
    • If there is no issue in the project, why does Gradle's dependencies task to report a failure?
  • Given "the consumer needed documentation for use during runtime", who the heck needs documentation at runtime? 🤓

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions