Igor Mukhin
11/10/2025, 11:00 AMIgor Mukhin
11/10/2025, 11:04 AM$ ./gradlew :conductor-app:dependencyInsight --dependency commons-io --configuration testRuntimeClasspath
Calculating task graph as no cached configuration is available for tasks: :conductor-app:dependencyInsight --dependency commons-io --configuration testRuntimeClasspath
> Task :conductor-app:dependencyInsight
commons-io:commons-io:20030203.000550
Variant runtime:
| Attribute Name | Provided | Requested |
|--------------------------------|--------------|--------------|
| org.gradle.status | release | |
| org.gradle.category | library | library |
| org.gradle.libraryelements | jar | jar |
| org.gradle.usage | java-runtime | java-runtime |
| org.gradle.dependency.bundling | | external |
| org.gradle.jvm.environment | | standard-jvm |
| org.gradle.jvm.version | | 25 |
Selection reasons:
- Selected by rule: Restricting commons-io:commons-io to version [2.14.0,)
commons-io:commons-io:2.11.0 -> 20030203.000550
\--- org.apache.zookeeper:zookeeper:3.8.4
+--- org.springframework.kafka:spring-kafka-test:3.3.10
| \--- testRuntimeClasspath (requested org.springframework.kafka:spring-kafka-test)
\--- org.apache.kafka:kafka_2.13:3.9.1
\--- org.springframework.kafka:spring-kafka-test:3.3.10 (requested org.apache.kafka:kafka_2.13:3.8.1) (*)
commons-io:commons-io:2.14.0 -> 20030203.000550
\--- org.apache.kafka:kafka_2.13:3.9.1
\--- org.springframework.kafka:spring-kafka-test:3.3.10 (requested org.apache.kafka:kafka_2.13:3.8.1)
\--- testRuntimeClasspath (requested org.springframework.kafka:spring-kafka-test)
commons-io:commons-io:2.20.0 -> 20030203.000550
\--- org.apache.commons:commons-compress:1.28.0
\--- org.testcontainers:testcontainers:1.21.3 (requested org.apache.commons:commons-compress:1.24.0)
+--- org.testcontainers:kafka:1.21.3
| \--- testRuntimeClasspath (requested org.testcontainers:kafka)
+--- org.testcontainers:mongodb:1.21.3
| \--- testRuntimeClasspath (requested org.testcontainers:mongodb)
\--- org.testcontainers:rabbitmq:1.21.3
\--- testRuntimeClasspath (requested org.testcontainers:rabbitmq)
I see here that Gradle follows the selection rule [2.14.0,) and using this rule select 20030203.000550.
Funny part is, that is was working all the time until today.
No Gradle configuration in the project was changed in the recent time.
Can it be some kind of a Gradle bug/regression?
How can I globally cancel the "`20030203.000550`" version of this library?
Thanks.Niels Doucet
11/10/2025, 11:10 AMIgor Mukhin
11/10/2025, 11:24 AMdependencies {
constraints {
testImplementation("commons-io:commons-io") {
version {
reject("20030203.000550")
}
}
}
}
the project still selects the wrong version:
$ ./gradlew :conductor-app:dependencyInsight --dependency commons-io --configuration testRuntimeClasspath
> Task :conductor-app:dependencyInsight
commons-io:commons-io:20030203.000550
...
Selection reasons:
- Selected by rule: Restricting commons-io:commons-io to version [2.14.0,)
- By constraint
commons-io:commons-io:{prefer 2.21.0; reject 20030203.000550} -> 20030203.000550
\--- testRuntimeClasspath
commons-io:commons-io:2.11.0 -> 20030203.000550
\--- org.apache.zookeeper:zookeeper:3.8.4
+--- org.springframework.kafka:spring-kafka-test:3.3.10
| \--- testRuntimeClasspath (requested org.springframework.kafka:spring-kafka-test)
\--- org.apache.kafka:kafka_2.13:3.9.1
\--- org.springframework.kafka:spring-kafka-test:3.3.10 (requested org.apache.kafka:kafka_2.13:3.8.1) (*)
commons-io:commons-io:2.14.0 -> 20030203.000550
\--- org.apache.kafka:kafka_2.13:3.9.1
\--- org.springframework.kafka:spring-kafka-test:3.3.10 (requested org.apache.kafka:kafka_2.13:3.8.1)
\--- testRuntimeClasspath (requested org.springframework.kafka:spring-kafka-test)
commons-io:commons-io:2.20.0 -> 20030203.000550
\--- org.apache.commons:commons-compress:1.28.0
\--- org.testcontainers:testcontainers:1.21.3 (requested org.apache.commons:commons-compress:1.24.0)
+--- org.testcontainers:kafka:1.21.3
| \--- testRuntimeClasspath (requested org.testcontainers:kafka)
+--- org.testcontainers:mongodb:1.21.3
| \--- testRuntimeClasspath (requested org.testcontainers:mongodb)
\--- org.testcontainers:rabbitmq:1.21.3
\--- testRuntimeClasspath (requested org.testcontainers:rabbitmq)
Tried to add "strictly" - same resultThomas Broyer
11/10/2025, 11:45 AM[2.14.0,) rule come from? Maybe change it to [2.14.0,20030203.000550) or similar then?Vampire
11/10/2025, 12:19 PM2.21.0 of commons-io was released.
https://repo1.maven.org/maven2/commons-io/commons-io/maven-metadata.xml lists 20030203.000550 as a version.
I guess before that release it was not listed as version there and thus not selected.Igor Mukhin
11/10/2025, 12:20 PMVampire
11/10/2025, 12:26 PMcommons-io. I don't find one related to this, though I mean to remember that I've seen this problem in the past already.Vampire
11/10/2025, 12:27 PMVampire
11/10/2025, 12:28 PMdependencies {
testImplementation("commons-io:commons-io:[2.14.0,)")
constraints {
testImplementation("commons-io:commons-io") {
version {
reject("20030203.000550")
}
}
}
}
it works as expected, resolving to 2.21.0.
And the SDM plugin is one of the typical causes for strange behavior in dependency resolution without visual sign in Build Scan or dependencyInsight output.Igor Mukhin
11/10/2025, 12:28 PMrestrictVersionOf("commons-io", "commons-io", "[2.14.0,)")
in our project. It was added to block out some old vulnerable versions.
Just removed it and it started to pick the proper version "2.20.0"Igor Mukhin
11/10/2025, 12:29 PMallprojects {
configurations.all {
resolutionStrategy {
eachDependency {
// restrict versions of some dependencies due to known vulnerabilities
restrictVersionOf("commons-io", "commons-io", "[2.14.0,)")
restrictVersionOf("org.apache.commons", "commons-compress", "[1.26.0,)")
}
}
}
}Igor Mukhin
11/10/2025, 12:29 PMVampire
11/10/2025, 12:29 PMrestrictVersionOf is also something customVampire
11/10/2025, 12:30 PMYes, we use Spring Dep MgmtIt is a relict from times when Gradle did not have built-in BOM support. By now it does more harm than good, and even the author of the plugin recommends not to use it anymore, but the built-in BOM support using
platform(...).Igor Mukhin
11/10/2025, 1:22 PMfun DependencyResolveDetails.restrictVersionOf(group: String, name: String, version: String) {
if (requested.group == group && requested.name == name) {
useVersion(version)
because("Restricting $group:$name to version $version")
}
}
so, it is just useVersionIgor Mukhin
11/10/2025, 1:40 PM