diff --git a/gradle/plugins/common/src/main/kotlin/junitbuild.temp-maven-repo.gradle.kts b/gradle/plugins/common/src/main/kotlin/junitbuild.temp-maven-repo.gradle.kts index f60def6c4df2..c7d0530580d8 100644 --- a/gradle/plugins/common/src/main/kotlin/junitbuild.temp-maven-repo.gradle.kts +++ b/gradle/plugins/common/src/main/kotlin/junitbuild.temp-maven-repo.gradle.kts @@ -22,10 +22,10 @@ subprojects { } } } - tasks.withType().configureEach { - if (name.endsWith("To${tempRepoName.capitalized()}Repository")) { - dependsOn(clearTempRepoDir) + tasks.withType() + .named { it.endsWith("To${tempRepoName.capitalized()}Repository") } + .configureEach { + dependsOn(clearTempRepoDir) } - } } }