[KOTLIN-SPRING] fix: use spring-cloud-dependencies BOM in Spring Boot 4 spring-cloud pom#24326
[KOTLIN-SPRING] fix: use spring-cloud-dependencies BOM in Spring Boot 4 spring-cloud pom#24326zaenk wants to merge 1 commit into
Conversation
|
thanks for the PR i wonder if you can create a test config similar to https://github.com/OpenAPITools/openapi-generator/blob/master/bin/configs/kotlin-spring-cloud.yaml (and generate the samples twice, commit the new files) to catch the issue moving forward. |
Chrimle
left a comment
There was a problem hiding this comment.
Awesome, thanks for the contribution! <3
For future reference; Here's the equivalent in JavaSpring, as described in the PR description.
954c73c to
059740d
Compare
…4 spring-cloud pom The kotlin-spring spring-cloud pom-sb4 template imports spring-cloud-starter-parent 2025.1.0 as a BOM, but that artifact is not published on Maven Central for the 2025.1.x train (only milestones/RCs exist) — so generated projects fail to resolve dependencies. The importable BOM for this train is spring-cloud-dependencies, which is what the JavaSpring spring-cloud pom-sb4 template already uses. Align kotlin-spring with it. Fixes OpenAPITools#24325
059740d to
3433c84
Compare
|
|
@wing328 @Chrimle thanks for the pointers, I've added the new sample, squashed into a single commit, and rebased to master, see #24326 (comment), pipeline is now green |
Chrimle
left a comment
There was a problem hiding this comment.
Looks great! ❤️
Disclaimer: I am not proficient in Kotlin, but the actual change (to the .mustache-file) is correct, and I trust the auto-generated sample files 👍
Fixes #24325
The
kotlin-springspring-cloudpom-sb4.mustachetemplate importsspring-cloud-starter-parent:2025.1.0as a managed BOM. That artifact is not published on Maven Central for the 2025.1.x train (only-M*/-RC*exist), so projects generated withkotlin-spring+library: spring-cloud+useSpringBoot4=truefail dependency resolution at build time.The correct, published importable BOM for this train is
spring-cloud-dependencies(2025.1.0GA, HTTP 200). TheJavaSpringgenerator's equivalentspring-cloud/pom-sb4.mustachealready usesspring-cloud-dependencies— this PR alignskotlin-springwith it.Change: one line in
modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom-sb4.mustache—
spring-cloud-starter-parent→spring-cloud-dependencies.Samples: no committed sample exercises this template path —
bin/configs/kotlin-spring-cloud.yamldoes not setuseSpringBoot4, and the onlyuseSpringBoot4kotlin-spring config (kotlin-spring-boot-4.yaml) useslibrary: spring-boot, notspring-cloud. Regenerating samples therefore produces no diff for this change.PR checklist
(No sample covers the kotlin-spring + spring-cloud + Spring Boot 4 path, so this produces no sample changes; template-only fix.)addedkotlin-spring-cloud-4sample@karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) @stefankoppier (2022/06) @e5l (2024/10)
Summary by cubic
Switch the Kotlin Spring
spring-cloudSpring Boot 4 pom to thespring-cloud-dependenciesBOM (2025.1.0) to fix dependency resolution and match the JavaSpring template. Adds a sample and config for thekotlin-spring+spring-cloud+useSpringBoot4=truepath to reproduce and validate.kotlin-spring/libraries/spring-cloud/pom-sb4.mustache, replacespring-cloud-starter-parentwithspring-cloud-dependencies.bin/configs/kotlin-spring-cloud-4.yamlandsamples/server/petstore/kotlin-spring-cloud-4(Gradle and Maven) to verify the BOM resolves.Written for commit 3433c84. Summary will update on new commits.