plugins {
id 'org.springframework.boot'
id 'groovy'
id 'java-library'
}
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-gradle-plugin:2.7.1'
}
But when a run the build I get
An exception occurred applying plugin request [id: 'myproject.java-conventions']
> Failed to apply plugin 'myproject.java-conventions'.
> org.gradle.api.plugins.UnknownPluginException: Plugin with id 'org.springframework.boot' not found.
You need to declare the dependency on the spring boot plugin in the build script that builds that plugin, so yourIncludedBuild/build.gradle(.kts) or buildSrc/build.gradle(.kts).
Where you defined it, it would be added as dependency for your actual project.
I’d strongly recommend not to use the io.spring.dependency-management though.
Besides that you don’t use it to import the BOM, you should imho prefer the built-in BOM support of Gradle using platform(...) if it is just about consuming the BOM.
That plugin comes from a time where Gradle did not have that support built-in, and it also does more than that, like porting over imho broken-by-design behavior from Maven over to the Gradle world.
So if you don’t use or need any of the additional functionalities, just use the built-in functionality.
When ‘importing’ dependencies, the difference is transitivity. When importing BOM, I don’t think they are any different.
I think ‘implmentation’ is not practical, you need to customize the introduction method