-
Notifications
You must be signed in to change notification settings - Fork 474
Update to Gradle 9 #2202
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
base: master
Are you sure you want to change the base?
Update to Gradle 9 #2202
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2202 +/- ##
============================================
- Coverage 81.90% 81.86% -0.05%
Complexity 4732 4732
============================================
Files 463 463
Lines 14767 14767
Branches 1869 1869
============================================
- Hits 12095 12089 -6
- Misses 1981 1987 +6
Partials 691 691 🚀 New features to boost your workflow:
|
Normally, the Spring Boot 2 Gradle Plugin would not be compatible with Gradle 9+ To get around this issue, we use the dependency-management plugin in isolation as described here: https://docs.spring.io/spring-boot/docs/2.7.7/gradle-plugin/reference/htmlsingle/#managing-dependencies.dependency-management-plugin.using-in-isolation This way, we get proper test execution and realistic version resolution on Gradle 9
// as described here: https://docs.spring.io/spring-boot/docs/2.7.7/gradle-plugin/reference/htmlsingle/#managing-dependencies.dependency-management-plugin.using-in-isolation | ||
// This way, we get proper test execution and realistic version resolution on Gradle 9 | ||
id 'org.springframework.boot' version "2.7.18" apply false | ||
id "io.spring.dependency-management" version "1.1.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about instead removing the plugin from both places?
It is a relict from times when Gradle did not have built-in BOM support, by now does more harm than good, and even its maintainer recommends not to use it anymore, but instead the built-in BOM support using platform(...)
.
@leonard84 what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially wanted this PR to be as non-invasive as possible which is why I opted for this variant.
I agree however that the bom variant would be much simpler.
Mostly regular maintenance.
The most interesting change is the setup of the Spring Boot 2 Gradle plugin (see 61dff17). Instead of applying it (which would lead to various compatibility issues), we just put it on the classpath and use the dependency-management plugin in isolation
as described here. This way we get proper test execution without even needing to apply the plugin.