[PR #729] [MERGED] codegen-java/kotlin: Support Spring Boot 3.x instead of 2.x #697

Closed
opened 2025-12-30 01:26:13 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/729
Author: @odenix
Created: 10/23/2024
Status: Merged
Merged: 10/25/2024
Merged by: @bioball

Base: mainHead: codegen-spring-2


📝 Commits (1)

  • 6d6b59b codegen-java/kotlin: Support Spring Boot 3.x instead of 2.x

📊 Changes

4 files changed (+4 additions, -18 deletions)

View changed files

📝 pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/JavaCodeGenerator.kt (+0 -4)
📝 pkl-codegen-java/src/test/kotlin/org/pkl/codegen/java/JavaCodeGeneratorTest.kt (+2 -5)
📝 pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/KotlinCodeGenerator.kt (+0 -4)
📝 pkl-codegen-kotlin/src/test/kotlin/org/pkl/codegen/kotlin/KotlinCodeGeneratorTest.kt (+2 -5)

📄 Description

Motivation:
In Spring Boot 3.0, the annotation type org.springframework.boot.context.properties.ConstructorBinding was deprecated in favor of org.springframework.boot.context.properties.bind.ConstructorBinding. In 3.2, the old annotation type was removed.
As of 3.0, a @ConstructorBinding annotation is no longer required/recommended for configuration classes with a single public constructor.

Changes:
Remove generation of @ConstructorBinding annotations in codegen-java and codegen-kotlin.

Result:

  • Generated code is compatible with Spring Boot 3.x. (Verified with locally updated pkl-spring.)
  • Generated code is no longer compatible with Spring Boot 2.x. To use Pkl 0.27 and later with Spring Boot 2.x, use Pkl 0.26's code generator.
  • Fixes #139.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/729 **Author:** [@odenix](https://github.com/odenix) **Created:** 10/23/2024 **Status:** ✅ Merged **Merged:** 10/25/2024 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `codegen-spring-2` --- ### 📝 Commits (1) - [`6d6b59b`](https://github.com/apple/pkl/commit/6d6b59bb3aa02578362a483a80e4e4c373bb0270) codegen-java/kotlin: Support Spring Boot 3.x instead of 2.x ### 📊 Changes **4 files changed** (+4 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/JavaCodeGenerator.kt` (+0 -4) 📝 `pkl-codegen-java/src/test/kotlin/org/pkl/codegen/java/JavaCodeGeneratorTest.kt` (+2 -5) 📝 `pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/KotlinCodeGenerator.kt` (+0 -4) 📝 `pkl-codegen-kotlin/src/test/kotlin/org/pkl/codegen/kotlin/KotlinCodeGeneratorTest.kt` (+2 -5) </details> ### 📄 Description Motivation: In Spring Boot 3.0, the annotation type `org.springframework.boot.context.properties.ConstructorBinding` was deprecated in favor of `org.springframework.boot.context.properties.bind.ConstructorBinding`. In 3.2, the old annotation type was removed. As of 3.0, a `@ConstructorBinding` annotation is no longer required/recommended for configuration classes with a single public constructor. Changes: Remove generation of `@ConstructorBinding` annotations in codegen-java and codegen-kotlin. Result: - Generated code is compatible with Spring Boot 3.x. (Verified with locally updated pkl-spring.) - Generated code is no longer compatible with Spring Boot 2.x. To use Pkl 0.27 and later with Spring Boot 2.x, use Pkl 0.26's code generator. - Fixes #139. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:26:13 +01:00
adam closed this issue 2025-12-30 01:26:13 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#697