Skip to content

Commit

Permalink
Avoid duplicate junit-platform.properties files caused by Kafka
Browse files Browse the repository at this point in the history
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 spring-projectsgh-41446
  • Loading branch information
wilkinsona committed Jul 11, 2024
1 parent 22413bd commit 784c8d2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spring-boot-project/spring-boot-autoconfigure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ plugins {

description = "Spring Boot AutoConfigure"

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.module.group == "org.apache.kafka" && details.requested.module.name == "kafka-server-common") {
details.artifactSelection {
selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
}
}
}
}

dependencies {
api(project(":spring-boot-project:spring-boot"))

Expand Down
9 changes: 9 additions & 0 deletions spring-boot-project/spring-boot-docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ configurations {
springApplicationExample
testSlices
antoraContent
all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.module.group == "org.apache.kafka" && details.requested.module.name == "kafka-server-common") {
details.artifactSelection {
selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
}
}
}
}
}

jar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ plugins {

description = "Spring Boot Kafka smoke test"

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.module.group == "org.apache.kafka" && details.requested.module.name == "kafka-server-common") {
details.artifactSelection {
selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
}
}
}
}

dependencies {
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
Expand Down

0 comments on commit 784c8d2

Please sign in to comment.