You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Linkage Checker Gradle plugin to work with circular dependencies #2174
I thought dom4j:dom4j:1.6.1 (compile) / jaxen:jaxen:1.1-beta-6 (compile, optional) would help but because it's an optional dependency, it doesn't work.
Let's try creating such relationship in local artifacts.
suztomo-macbookpro44% cat build.gradle
plugins {
id 'java'
id 'com.google.cloud.tools.linkagechecker' version "1.5.9"
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal()
}
// This module has cycle
// [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ moduleB ---
// [INFO] org.example:moduleB:jar:2.0-SNAPSHOT
// [INFO] +- (org.example:moduleB:jar:1.0-SNAPSHOT:compile - omitted for cycle)
// [INFO] \- org.example:moduleA:jar:1.0-SNAPSHOT:compile
dependencies {
compile 'org.example:moduleB:2.0-SNAPSHOT'
}
linkageChecker {
configurations = ['compile']
}
suztomo-macbookpro44% ./gradlew linkageCheck
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
None of the artifacts above define dependency on jackson-bom. Why does Gradle think com.fasterxml.jackson.core:jackson-core:2.12.3 depends on com.fasterxml.jackson:jackson-bom?
Maven also thinks that jackson-core doesn't depend on jackson-bom.
This also shows missing references from the artifact.
Class org.apache.beam.model.fnexecution.v1.BeamFnApi$WorkerStatusResponse is not found;
referenced by 2 class files
org.apache.beam.repackaged.direct_java.runners.fnexecution.status.WorkerStatusClient (org.apache.beam:beam-runners-direct-java:2.30.0)
org.apache.beam.repackaged.direct_java.runners.fnexecution.status.BeamWorkerStatusGrpcService (org.apache.beam:beam-runners-direct-java:2.30.0)
Cause:
Unknown
Activity
suztomo commentedon Aug 11, 2021
I thought
dom4j:dom4j:1.6.1 (compile) / jaxen:jaxen:1.1-beta-6 (compile, optional)would help but because it's an optional dependency, it doesn't work.Let's try creating such relationship in local artifacts.
suztomo commentedon Aug 11, 2021
Created:
With the following pom file installed:
This Gradle build succeeds:
A test case that uses local artifacts. https://gist.github.com/suztomo/473ea281f6deebf8804197bec53a873c
suztomo commentedon Aug 11, 2021
The code from LinkageCheckTask.java
It's either
createDependencyGraphfails to record visited node while iterating the dependencies from the "configuration".Maybe we could add debug output in the plugin.
suztomo commentedon Aug 11, 2021
Found a real-world example:
In the dependency tree of com.google.cloud:google-cloud-bigquery:1.137.1:
None of the artifacts above define dependency on jackson-bom. Why does Gradle think com.fasterxml.jackson.core:jackson-core:2.12.3 depends on com.fasterxml.jackson:jackson-bom?
Maven also thinks that jackson-core doesn't depend on jackson-bom.
suztomo commentedon Aug 11, 2021
Now, it outputs too many circulear dependencies message for artifacts with large dependencies.
suztomo commentedon Aug 11, 2021
This also shows missing references from the artifact.
suztomo commentedon Aug 12, 2021
Fixed in #2181