-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Clarification on Kotlin support #44651
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
To provide a bit more context: I recently came across issues with Detekt, which I am finding is quite commonly used across Kotlin projects and teams. Versioning becomes really important when using certain Kotlin tools, like Detekt, that are strictly coupled with the Kotlin compiler version, even at the patch-level, no less. :( See the Compatibility Table. I have experienced errors like this even between patch versions As you can see, Detekt has a version based on To be clear, I am not expecting the stars to align between disparate projects, but that the path to resolution is more clear. I am currently in the process of making an early decision to base Kotlin projects, for which I am partly responsible for, on Kotlin |
DISCLAIMER: I am still learning and have a lot to learn in the Kotlin space. |
Another quick questions... I feel pretty confident in saying that (asking if) Spring Boot's next significant (e.g. major) version bump of Kotlin (i.e. |
I can confirm that Spring Boot
Yes, it will. |
Saying that Spring Boot requires at least 1.7.x is accurate as the small amount of Kotlin code that we have is compiled with the API version and language version set to We have CI for several different versions of Java and make a stronger statement about supported versions of a result. We don't have any plans to do the same for Kotlin. We have very little Kotlin code and I don't recall any bugs being reported regarding version compatibility. The benefits of that CI would be outweighed by the cost of setting it up and maintaining it. Lastly, our Kotlin requirements are largely driven by those of Spring Framework. All in all, I think we've said about as much as we can about the required version of Kotlin so I'm going to close this one. @sdeleuze do you have any plans on the Framework side to make a strong statement about the version requirements or to expand testing to cover multiple versions of Kotlin? |
+1 to what @wilkinsona said. We try to keep an extended compatibility of 2 minor releases before the Kotlin version used for compilation and test because this is what the Kotlin team claims to support. I don't know in details Detekt, but based on my quick read of its documentation it seems to be implemented as a Kotlin compiler plugin which is known to be very fragile, hence the fact JetBrains and Google advise to use https://github.com/google/ksp instead. Spring does not implement a Kotlin compiler plugin, so the versioning constraints are more flexible for us. As you may have noticed, in practice it is mostly possible to run Spring Boot with Kotlin 2.0/2.1, but you need to manually downgrade the potential Kotlin Serialization / Kotlin Coroutines versions used, and there may be issues at Gradle plugin support level, hence the fact we don't claim/deny explicitly compatibility. Spring Framework 7 and Spring Boot 4 are expected to provide most tested / first class support for Kotlin 2 (with a Kotlin 2.2 baseline). |
Thank you for sharing your thoughts and position @wilkinsona and @sdeleuze. Makes good sense. |
Thank you for sharing your experience @dmitrysulman. |
Lastly, Detekt is more similar to SpotBugs or PMD for Java in function and purpose (OOTB) than any annotation/symbol processing tool (or even a general Linter, like Ktlint). I only learned about Detekt recently, and haven't found a suitable replacement based on its capabilities and our use. |
Hello Spring Boot team-
While I am aware of the System Requirements and Kotlin Support documentation, I am wondering whether I am missing more specific details on Kotlin supported versions.
As mentioned in Requirements, "Spring Boot requires at least Kotlin
1.7.x
...".Technically, Spring Boot seems to use a Kotlin
1.9.x
baseline, and specifically1.9.25
(here as applied here).Would it be advisable to call out supported Kotlin versions in System Requirements in the same manner as Spring Boot does for Java, having a baseline of Java
17
, but compatible up to and including Java23
?For example:
"Spring Boot is based on Kotlin
1.9.x
(err...1.7.x
?), currently1.9.25
, but is compatible with versions up to and including Kotlin2.0.x
."I am quite certain Spring Boot will work with Kotlin
2.0.21
and likely even2.1.x
. I already have some examples of using Kotlin2.0.21
with Spring Boot in the work I am doing, but I feel that some sort of reassurance from the Spring Boot team, probably having done the testing effort to assert compatibility with Kotlin2.0.x
, maybe even2.1.x
, would definitely cement users early confidence.WDYT?
The text was updated successfully, but these errors were encountered: