Code Monkey home page Code Monkey logo

Comments (3)

autonomousapps avatar autonomousapps commented on September 26, 2024

Thanks for filing the issue, but I'm not sure what you're asking me to do here.

from dependency-analysis-gradle-plugin.

NoPhaseNoKill avatar NoPhaseNoKill commented on September 26, 2024

Sorry if this wasn't clear.

  1. To prevent long-term transitive dependency conflicts, explicitly select versions that are pulled in by transitive dependencies, by adding something like this to the root build.gradle.kts of the project:
configurations.all {
  resolutionStrategy {
    failOnVersionConflict()
  }
}
  1. This produces errors:
......

* What went wrong:
Could not determine the dependencies of task ':compileGroovy'.
> Could not resolve all dependencies for configuration ':compileClasspath'.
   > Conflicts found for the following modules:
       - org.jetbrains.kotlin:kotlin-stdlib between versions 1.9.20, 1.9.10 and 1.4.20
       - org.jetbrains.kotlin:kotlin-reflect between versions 1.9.20, 1.9.10 and 1.7.0
       - org.jetbrains.kotlin:kotlin-stdlib-jdk8 between versions 1.9.10, 1.7.0, 1.7.20 and 1.8.0
       - org.jetbrains.kotlin:kotlin-stdlib-jdk7 between versions 1.9.10 and 1.8.0
       - org.checkerframework:checker-qual between versions 3.21.4 and 3.12.0
       - com.google.errorprone:error_prone_annotations between versions 2.13.1 and 2.11.0
       - org.jetbrains.kotlin:kotlin-stdlib-common between versions 1.9.20, 1.9.10 and 1.4.20
  1. Fix said errors

Please note: This is merely one option you have. Other details can be found here:

https://docs.gradle.org/current/userguide/dependency_capability_conflict.html
https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/ResolutionStrategy.html#capabilitiesResolution

from dependency-analysis-gradle-plugin.

NoPhaseNoKill avatar NoPhaseNoKill commented on September 26, 2024

After further investigation, it turned out that the original issue was what I'll call a 'skill gap' haha.

Your library doesn't introduce transitive dependencies on the classpath, this was due to the way I was implementing it. For future reference, see working example here: https://github.com/NoPhaseNoKill/monorepo/tree/08e26fda3751aa7f101fdb0af208f80475dc6fd5

Resulting output is:

> Task :modules:applications:app:dependencies

------------------------------------------------------------
Project ':modules:applications:app'
------------------------------------------------------------

annotationProcessor - Annotation processors and their dependencies for source set 'main'.
No dependencies

api - API dependencies for null/main (n)
No dependencies

apiDependenciesMetadata
No dependencies

apiElements - API elements for the 'main' feature. (n)
No dependencies

apiElements-published (n)
No dependencies

compileClasspath - Compile classpath for null/main.
+--- project :modules:libraries:utilities
|    +--- project :modules:libraries:list
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
|    |         \--- org.jetbrains:annotations:13.0
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
+--- project :modules:libraries:list (*)
+--- org.apache.commons:commons-text:1.10.0
|    \--- org.apache.commons:commons-lang3:3.12.0
\--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)

compileOnly - Compile only dependencies for null/main. (n)
No dependencies

compileOnlyDependenciesMetadata
No dependencies

default - Configuration for default artifacts. (n)
No dependencies

implementation - Implementation only dependencies for null/main. (n)
+--- project utilities (n)
+--- project list (n)
+--- org.apache.commons:commons-text:1.10.0 (n)
\--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (n)

implementationDependenciesMetadata
+--- project :modules:libraries:utilities
|    +--- project :modules:libraries:list
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
+--- project :modules:libraries:list (*)
+--- org.apache.commons:commons-text:1.10.0
|    \--- org.apache.commons:commons-lang3:3.12.0
\--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20

intransitiveDependenciesMetadata
No dependencies

kotlinBuildToolsApiClasspath
\--- org.jetbrains.kotlin:kotlin-build-tools-impl:1.9.20
     +--- org.jetbrains.kotlin:kotlin-build-tools-api:1.9.20
     +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
     |    \--- org.jetbrains:annotations:13.0
     +--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.20
     |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
     |    +--- org.jetbrains.kotlin:kotlin-script-runtime:1.9.20
     |    +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10
     |    +--- org.jetbrains.kotlin:kotlin-daemon-embeddable:1.9.20
     |    \--- org.jetbrains.intellij.deps:trove4j:1.0.20200330
     \--- org.jetbrains.kotlin:kotlin-compiler-runner:1.9.20
          +--- org.jetbrains.kotlin:kotlin-build-common:1.9.20
          +--- org.jetbrains.kotlin:kotlin-daemon-client:1.9.20
          +--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0
          \--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.20 (*)

kotlinCompilerClasspath
\--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.20
     +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
     |    \--- org.jetbrains:annotations:13.0
     +--- org.jetbrains.kotlin:kotlin-script-runtime:1.9.20
     +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10
     +--- org.jetbrains.kotlin:kotlin-daemon-embeddable:1.9.20
     \--- org.jetbrains.intellij.deps:trove4j:1.0.20200330

kotlinCompilerPluginClasspath
No dependencies

kotlinCompilerPluginClasspathMain - Kotlin compiler plugins for compilation
\--- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.9.20
     +--- org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.9.20
     |    +--- org.jetbrains.kotlin:kotlin-scripting-common:1.9.20
     |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
     |    |         \--- org.jetbrains:annotations:13.0
     |    +--- org.jetbrains.kotlin:kotlin-scripting-jvm:1.9.20
     |    |    +--- org.jetbrains.kotlin:kotlin-script-runtime:1.9.20
     |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
     |    |    \--- org.jetbrains.kotlin:kotlin-scripting-common:1.9.20 (*)
     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
     \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)

kotlinCompilerPluginClasspathTest - Kotlin compiler plugins for compilation
\--- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.9.20
     +--- org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.9.20
     |    +--- org.jetbrains.kotlin:kotlin-scripting-common:1.9.20
     |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
     |    |         \--- org.jetbrains:annotations:13.0
     |    +--- org.jetbrains.kotlin:kotlin-scripting-jvm:1.9.20
     |    |    +--- org.jetbrains.kotlin:kotlin-script-runtime:1.9.20
     |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
     |    |    \--- org.jetbrains.kotlin:kotlin-scripting-common:1.9.20 (*)
     |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
     \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)

kotlinKlibCommonizerClasspath
\--- org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.9.20
     +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
     |    \--- org.jetbrains:annotations:13.0
     \--- org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.20
          +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
          +--- org.jetbrains.kotlin:kotlin-script-runtime:1.9.20
          +--- org.jetbrains.kotlin:kotlin-reflect:1.6.10
          +--- org.jetbrains.kotlin:kotlin-daemon-embeddable:1.9.20
          \--- org.jetbrains.intellij.deps:trove4j:1.0.20200330

kotlinNativeCompilerPluginClasspath
No dependencies

kotlinScriptDef - Script filename extensions discovery classpath configuration
No dependencies

kotlinScriptDefExtensions
No dependencies

mainSourceElements - List of source directories contained in the Main SourceSet. (n)
No dependencies

runtimeClasspath - Runtime classpath of null/main.
+--- project :modules:libraries:utilities
|    +--- project :modules:libraries:list
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
|    |         \--- org.jetbrains:annotations:13.0
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
+--- project :modules:libraries:list (*)
+--- org.apache.commons:commons-text:1.10.0
|    \--- org.apache.commons:commons-lang3:3.12.0
\--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)

runtimeElements - Runtime elements for the 'main' feature. (n)
No dependencies

runtimeElements-published (n)
No dependencies

runtimeOnly - Runtime only dependencies for null/main. (n)
No dependencies

testAnnotationProcessor - Annotation processors and their dependencies for source set 'test'.
No dependencies

testApi - API dependencies for null/test (n)
No dependencies

testApiDependenciesMetadata
No dependencies

testCompileClasspath - Compile classpath for null/test.
+--- project :modules:libraries:utilities
|    +--- project :modules:libraries:list
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
|    |         \--- org.jetbrains:annotations:13.0
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
+--- project :modules:libraries:list (*)
+--- org.apache.commons:commons-text:1.10.0
|    \--- org.apache.commons:commons-lang3:3.12.0
+--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
\--- org.junit.jupiter:junit-jupiter-api:5.10.1
     +--- org.junit:junit-bom:5.10.1
     |    +--- org.junit.jupiter:junit-jupiter-api:5.10.1 (c)
     |    \--- org.junit.platform:junit-platform-commons:1.10.1 (c)
     +--- org.opentest4j:opentest4j:1.3.0
     +--- org.junit.platform:junit-platform-commons:1.10.1
     |    +--- org.junit:junit-bom:5.10.1 (*)
     |    \--- org.apiguardian:apiguardian-api:1.1.2
     \--- org.apiguardian:apiguardian-api:1.1.2

testCompileOnly - Compile only dependencies for null/test. (n)
No dependencies

testCompileOnlyDependenciesMetadata
No dependencies

testImplementation - Implementation only dependencies for null/test. (n)
\--- org.junit.jupiter:junit-jupiter-api:5.10.1 (n)

testImplementationDependenciesMetadata
+--- project :modules:libraries:utilities
|    +--- project :modules:libraries:list
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
+--- project :modules:libraries:list (*)
+--- org.apache.commons:commons-text:1.10.0
|    \--- org.apache.commons:commons-lang3:3.12.0
+--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
\--- org.junit.jupiter:junit-jupiter-api:5.10.1
     +--- org.junit:junit-bom:5.10.1
     |    +--- org.junit.jupiter:junit-jupiter-api:5.10.1 (c)
     |    \--- org.junit.platform:junit-platform-commons:1.10.1 (c)
     +--- org.opentest4j:opentest4j:1.3.0
     +--- org.junit.platform:junit-platform-commons:1.10.1
     |    +--- org.junit:junit-bom:5.10.1 (*)
     |    \--- org.apiguardian:apiguardian-api:1.1.2
     \--- org.apiguardian:apiguardian-api:1.1.2

testIntransitiveDependenciesMetadata
No dependencies

testKotlinScriptDef - Script filename extensions discovery classpath configuration
No dependencies

testKotlinScriptDefExtensions
No dependencies

testRuntimeClasspath - Runtime classpath of null/test.
+--- project :modules:libraries:utilities
|    +--- project :modules:libraries:list
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20
|    |         \--- org.jetbrains:annotations:13.0
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
+--- project :modules:libraries:list (*)
+--- org.apache.commons:commons-text:1.10.0
|    \--- org.apache.commons:commons-lang3:3.12.0
+--- org.jetbrains.kotlin:kotlin-stdlib:1.9.20 (*)
+--- org.junit.jupiter:junit-jupiter-api:5.10.1
|    +--- org.junit:junit-bom:5.10.1
|    |    +--- org.junit.jupiter:junit-jupiter-api:5.10.1 (c)
|    |    +--- org.junit.jupiter:junit-jupiter-engine:5.10.1 (c)
|    |    +--- org.junit.platform:junit-platform-commons:1.10.1 (c)
|    |    \--- org.junit.platform:junit-platform-engine:1.10.1 (c)
|    +--- org.opentest4j:opentest4j:1.3.0
|    \--- org.junit.platform:junit-platform-commons:1.10.1
|         \--- org.junit:junit-bom:5.10.1 (*)
\--- org.junit.jupiter:junit-jupiter-engine -> 5.10.1
     +--- org.junit:junit-bom:5.10.1 (*)
     +--- org.junit.platform:junit-platform-engine:1.10.1
     |    +--- org.junit:junit-bom:5.10.1 (*)
     |    +--- org.opentest4j:opentest4j:1.3.0
     |    \--- org.junit.platform:junit-platform-commons:1.10.1 (*)
     \--- org.junit.jupiter:junit-jupiter-api:5.10.1 (*)

However, the secondary issue around transitive dependency conflicts for your library still exist. I'll leave this up to you decide whether you want to leave this open and put it in the backlog - or whether you don't care and are happy to run the risk of having multiple transitive dependency versions which may or may not conflict with each other.

Thanks once again for your time and effort surrounding the plugin. Apologies for the original issue being misleading.

from dependency-analysis-gradle-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.