Skip to content

[KOTLIN-SPRING] fix: use spring-cloud-dependencies BOM in Spring Boot 4 spring-cloud pom#24326

Open
zaenk wants to merge 1 commit into
OpenAPITools:masterfrom
zaenk:fix/kotlin-spring-cloud-pom-sb4-bom
Open

[KOTLIN-SPRING] fix: use spring-cloud-dependencies BOM in Spring Boot 4 spring-cloud pom#24326
zaenk wants to merge 1 commit into
OpenAPITools:masterfrom
zaenk:fix/kotlin-spring-cloud-pom-sb4-bom

Conversation

@zaenk

@zaenk zaenk commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #24325

The kotlin-spring spring-cloud pom-sb4.mustache template imports spring-cloud-starter-parent:2025.1.0 as a managed BOM. That artifact is not published on Maven Central for the 2025.1.x train (only -M*/-RC* exist), so projects generated with kotlin-spring + library: spring-cloud + useSpringBoot4=true fail dependency resolution at build time.

The correct, published importable BOM for this train is spring-cloud-dependencies (2025.1.0 GA, HTTP 200). The JavaSpring generator's equivalent spring-cloud/pom-sb4.mustache already uses spring-cloud-dependencies — this PR aligns kotlin-spring with it.

Change: one line in
modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-cloud/pom-sb4.mustache
spring-cloud-starter-parentspring-cloud-dependencies.

Samples: no committed sample exercises this template path — bin/configs/kotlin-spring-cloud.yaml does not set useSpringBoot4, and the only useSpringBoot4 kotlin-spring config (kotlin-spring-boot-4.yaml) uses library: spring-boot, not spring-cloud. Regenerating samples therefore produces no diff for this change.

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (No sample covers the kotlin-spring + spring-cloud + Spring Boot 4 path, so this produces no sample changes; template-only fix.) added kotlin-spring-cloud-4 sample
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@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-cloud Spring Boot 4 pom to the spring-cloud-dependencies BOM (2025.1.0) to fix dependency resolution and match the JavaSpring template. Adds a sample and config for the kotlin-spring + spring-cloud + useSpringBoot4=true path to reproduce and validate.

  • Bug Fixes
    • In kotlin-spring/libraries/spring-cloud/pom-sb4.mustache, replace spring-cloud-starter-parent with spring-cloud-dependencies.
    • Add bin/configs/kotlin-spring-cloud-4.yaml and samples/server/petstore/kotlin-spring-cloud-4 (Gradle and Maven) to verify the BOM resolves.

Written for commit 3433c84. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@wing328

wing328 commented Jul 17, 2026

Copy link
Copy Markdown
Member

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 Chrimle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for the contribution! <3

For future reference; Here's the equivalent in JavaSpring, as described in the PR description.

@zaenk
zaenk force-pushed the fix/kotlin-spring-cloud-pom-sb4-bom branch 3 times, most recently from 954c73c to 059740d Compare July 20, 2026 13:02
…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
@zaenk
zaenk force-pushed the fix/kotlin-spring-cloud-pom-sb4-bom branch from 059740d to 3433c84 Compare July 20, 2026 13:14
@zaenk

zaenk commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author
  • rebased to master and added new sample config in 833953e
  • rebuilt openapi jar with ./mvnw clean install -pl modules/openapi-generator-cli -am -DskipTests
  • generated samples with ./bin/generate-samples.sh bin/configs/kotlin-spring-cloud-4.yaml
  • commited, rebased original commit to this one, rebuilt sources, observed the fix in 954c73c
  • squashed, rebased to master, rebuilt the jar and samples for kotlin-spring-cloud-4 again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][KOTLIN][SPRING] Spring Boot 4 spring-cloud pom imports unpublished spring-cloud-starter-parent BOM

3 participants