Skip to content

Commit 035886b

Browse files
committed
Do not add 'listenablefuture' capability to 'listenablefuture' itself
1 parent 1e1ad87 commit 035886b

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/main/java/org/gradlex/jvm/dependency/conflict/detection/rules/CapabilityDefinition.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ public enum CapabilityDefinition {
203203
"org.lz4:lz4-java"
204204
),
205205
LISTENABLEFUTURE(FIRST_MODULE, "com.google.guava", GuavaListenableFutureRule.class,
206-
"com.google.guava:guava",
207-
"com.google.guava:listenablefuture"
206+
"com.google.guava:guava"
208207
),
209208
HAMCREST_LIBRARY(FIRST_MODULE,
210209
"org.hamcrest:hamcrest",

src/test/groovy/org/gradlex/jvm/dependency/conflict/test/CapabilityWithDifferentVersionsTest.groovy

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,29 @@ class CapabilityWithDifferentVersionsTest extends Specification {
4141
expect:
4242
printJars()
4343
}
44+
45+
def "does not fail with empty listenable future dependency on the classpath"() {
46+
given:
47+
buildFile << """
48+
plugins {
49+
id("org.gradlex.jvm-dependency-conflict-resolution")
50+
id("java-library")
51+
}
52+
tasks.withType<JavaCompile>().configureEach {
53+
options.release = 17
54+
}
55+
repositories.mavenCentral()
56+
dependencies {
57+
implementation(platform("com.google.cloud:spring-cloud-gcp-dependencies:5.2.0"))
58+
implementation("com.google.cloud:spring-cloud-gcp-starter-bigquery") // <--- (1)
59+
}
60+
61+
tasks.register("printJars") {
62+
println(configurations.compileClasspath.get().files.joinToString("\\n") { it.name })
63+
}
64+
"""
65+
66+
expect:
67+
printJars()
68+
}
4469
}

0 commit comments

Comments
 (0)