Skip to content
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

Question: Spring Boot dependency management plugin #20

Closed
randyhbh opened this issue May 12, 2024 · 1 comment
Closed

Question: Spring Boot dependency management plugin #20

randyhbh opened this issue May 12, 2024 · 1 comment
Labels

Comments

@randyhbh
Copy link

Hi @jjohannes, Thank you for all the effort you have put into this repo and for sharing your knowledge about Gradle through your fantastic compilation of videos on YouTube.

I was reviewing the setup project for Java + Spring Boot that you have shared, and I noticed that the id("io.spring.dependency-management") version "1.1.4" plugin, which provides dependency version resolution for all Spring Boot based projects, was not used.

I am curious to know why you chose not to use this plugin. I would appreciate it if you could share your thoughts on this matter.

@jjohannes
Copy link
Owner

Hi @randyhbh. Thanks for the feedback and the question. 🙏

I think the docs on the id("io.spring.dependency-management") are not very clear on this topic. Since Gradle 6, Gradle fully supports using BOMs directly. Which in most cases makes the plugin obsolete. In special cases it may have some interesting additional functionality. I found this issue comment listing the differences.

I prefer not using the plugin if not specifically needed, because it may have unexpected effects on the resolution result by the way it "forces" all versions of spring-boot-dependencies. But it can be a choice to use the plugin if there is a good reason.

In this example, I do not use it and have this instead in the platform project:

dependencies {
  api(platform("org.springframework.boot:spring-boot-dependencies:2.7.18"))
  // ...
}

Which means that my own platform/BOM extends the spring-boot-dependencies platform/BOM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants