mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
Support for Spring Boot 3 ConstructorBinding annotation #58
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @namhptran on GitHub (Feb 13, 2024).
a28ef85698/pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/JavaCodeGenerator.kt (L494)Currently Java Code Generator with Spring Boot Configurations generates classes with annotation
org.springframework.boot.context.properties.ConstructorBinding.This was deprecated in Spring Boot 3.0.0 and as of Spring Boot 3.2.0 this has been removed in favour of
org.springframework.boot.context.properties.bind.ConstructorBinding.https://docs.spring.io/spring-boot/docs/3.0.0/api/org/springframework/boot/context/properties/ConstructorBinding.html
@namhptran commented on GitHub (Feb 13, 2024):
To add, while Spring Boot 2 supports both class level annotation and constructor level annotation, Spring Boot 3 requires Constructor level annotation (which optionally can also be omitted). Currently it adds to the Class with no option for adding to the Constructor instead.
I think there needs to be an option to exclude this annotation if using Spring Boot 3
@bioball commented on GitHub (Feb 14, 2024):
Makes sense!
@odenix commented on GitHub (Oct 18, 2024):
@bioball Do both versions need to be supported, or is Boot 3 good enough?
@odenix commented on GitHub (Oct 22, 2024):
Supporting multiple Spring Boot versions will, at a minimum, require to
springBootVersionproperty toCliJavaCodeGeneratorOptions,CliKotlinCodeGeneratorOptions,JavaCodeGenerator,KotlinCodeGenerator, andCodeGenSpec(Gradle plugin).@bioball I'd like to send a PR in time for 0.27 but first need a decision. (I don't really mind, I just want to fix the problem.)
PS: Spring Boot seems to follow a tip and tail release model much like the JDK. OSS support for 2.x ended a year ago. Enterprise support for 2.x ends 12/2026. https://spring.io/projects/spring-boot#support
@bioball commented on GitHub (Oct 22, 2024):
I don't really have a strong opinion here. @holzensp or @stackoverflow, any thoughts?
@translatenix what's your opinion? Should Pkl remove Spring Boot 2 support?
@odenix commented on GitHub (Oct 22, 2024):
As OSS support for Boot 2.x ended a year ago and Pkl is cutting edge (0.x), I’m inclined to drop Boot 2.x support unless you have internal users that can neither update to Boot 3.x nor stay on Pkl 0.26. (Probably they’d just need to stay on the 0.26 code generator.)
@stackoverflow commented on GitHub (Oct 23, 2024):
Agree that we can drop support for Boot 2.x. We dropped support for unmaintained Java versions, so it's in line to do the same with Spring.
@holzensp commented on GitHub (Oct 24, 2024):
Enterprise support is running until 2027, but I agree; if folks can't bump their Spring, they'll likely also be fine staying on 0.26 (codegen)
@odenix commented on GitHub (Oct 24, 2024):
From the support page I linked to: