Skip to content

Commit 784c8d2

Browse files
committed
Avoid duplicate junit-platform.properties files caused by Kafka
Gradle doesn't support excluding a dependency that's declared with a classifier. Instead, this commit replaces the test-qualified kafka-server-common dependency with the plain dependency. The plain dependency was already present so this is equivalent to excluding the test-qualified dependency. Closes gh-41446
1 parent 22413bd commit 784c8d2

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

spring-boot-project/spring-boot-autoconfigure/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ plugins {
1010

1111
description = "Spring Boot AutoConfigure"
1212

13+
configurations.all {
14+
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
15+
if (details.requested.module.group == "org.apache.kafka" && details.requested.module.name == "kafka-server-common") {
16+
details.artifactSelection {
17+
selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
18+
}
19+
}
20+
}
21+
}
22+
1323
dependencies {
1424
api(project(":spring-boot-project:spring-boot"))
1525

spring-boot-project/spring-boot-docs/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ configurations {
1515
springApplicationExample
1616
testSlices
1717
antoraContent
18+
all {
19+
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
20+
if (details.requested.module.group == "org.apache.kafka" && details.requested.module.name == "kafka-server-common") {
21+
details.artifactSelection {
22+
selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
23+
}
24+
}
25+
}
26+
}
1827
}
1928

2029
jar {

spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ plugins {
66

77
description = "Spring Boot Kafka smoke test"
88

9+
configurations.all {
10+
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
11+
if (details.requested.module.group == "org.apache.kafka" && details.requested.module.name == "kafka-server-common") {
12+
details.artifactSelection {
13+
selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
14+
}
15+
}
16+
}
17+
}
18+
919
dependencies {
1020
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
1121
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))

0 commit comments

Comments
 (0)