-
Notifications
You must be signed in to change notification settings - Fork 197
Don't apply Spring Boot's plugin to the library project #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please also mention how to achieve this for (convention) plugins. In my case I'm using The boot dependencies and features work if I add More about convention plugins: https://docs.gradle.org/current/samples/sample_convention_plugins.html#compiling_convention_plugins |
IMO, conventions plugins are out of the scope of this guide. They're really just an encapsulation of logic that could be written in a build.gradle so the recommendations in this guide (once updated) should equally apply when wrapped up in a conventions plugin. |
@C-Otto @wilkinsona this happened to me today with plugins {
id("org.springframework.boot") apply false
id("io.spring.dependency-management")
}
ext["snakeyaml.version"] = "2.2"
dependencyManagement {
imports{
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
}
} With this implementation dependencies for the convention plugins: implementation("org.springframework.boot:spring-boot-gradle-plugin:3.1.5")
implementation("io.spring.gradle:dependency-management-plugin:1.1.3") The parent project has the boot plugin applied, all the subprojects use this convention plugin. But all subprojects had the |
i did it as @tomasAlabes did, have one convention plugin but the apply false does not disable the bootJar task so it fails when there is no MainClass in another module , how would be a way to make a multimodule project (with convention plugin) when you are doing for example a library but wants to use the dependency management? |
The guide currently applies Boot's Gradle plugin to the library project and then disables the
bootJar
task but that's not what we recommend. Instead, it should just use Boot's dependency management in the library project. Boot's documentation describes how to do this.The text was updated successfully, but these errors were encountered: