If I am configuring subprojects' dependencies via a filter, I expect the implementation function to work.
Gradle fails to build with the following message:
Configuration with name 'implementation' not found.
This happens because of the dependencies {...} block below:
// apply the proper plugins & configuration for Spring Boot subprojects
configure(subprojects.filter { project -> isSpringBootProject(project) }) {
val springBootVersion: String by project
apply(plugin = "org.springframework.boot")
apply(plugin = "io.spring.dependency-management")
val implementation by configurations
dependencies {
implementation(platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion"))
}
}
I am starting a multi project build from scratch. I want the root build script to control common dependencies so that I can minimize duplication in subproject build.gradle.kts files.
I am starting with a list of subproject names that should apply common Spring Boot plugins and dependencies. If the project is in that list, I want it to use the a common BOM as described in these docs:
implementation(platform(...))
try
gradle subproject:build
Try:
dependencies {
"implementation"(platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion"))
}
Using Gradle 5.1 @JLLeitschuh solution was not working for me. I got this to work by adding the following:
subprojects{
apply(plugin = "java")
}
The implementation configuration is registered by the java plugin. The error reports you got make sense. Good you figured it out, closing.
Somebody had the same problem on stackoverflow, and there's an example _build.gradle.kts_ that fix the issue there, leaving it here for anyone that might land on this page.
Most helpful comment
Using Gradle 5.1 @JLLeitschuh solution was not working for me. I got this to work by adding the following:
subprojects{ apply(plugin = "java") }