Skip to content

Use Spring Boot 3.x by default (useSpringBoot3=true)#23318

Merged
wing328 merged 10 commits intomasterfrom
springboot3default
Mar 23, 2026
Merged

Use Spring Boot 3.x by default (useSpringBoot3=true)#23318
wing328 merged 10 commits intomasterfrom
springboot3default

Conversation

@wing328
Copy link
Copy Markdown
Member

@wing328 wing328 commented Mar 23, 2026

cc @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) @martin-mfg (2023/08)

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • 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
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Make Spring Boot 3 the default for generated Spring projects (useSpringBoot3=true in SpringCodegen). Update docs and samples for Jakarta and Java 17; add CI to keep Boot 2 coverage; useSpringBoot4 now auto-disables Boot 3.

  • Dependencies

    • Upgrade samples to Spring Boot 3.3.13, Spring Cloud 2023.0.0, and Java 17; main samples workflow runs on JDK 17; add a JDK 11 workflow for springboot-implicitHeaders and springboot-implicitHeaders-annotationLibrary with useSpringBoot3=false; set useSpringBoot3=false in java-camel-petstore-new.yaml to preserve Boot 2 coverage.
    • Switch to springdoc-openapi-starter-webmvc-ui (2.2.0); bump org.openapitools:jackson-databind-nullable to 0.2.9; manage spring-security-oauth2-client via the BOM.
    • Default useSpringBoot3 to true in code and docs; move generated imports to jakarta.*; use org.springdoc.core.annotations.ParameterObject.
  • Migration

    • To keep Spring Boot 2 behavior, set useSpringBoot3=false.
    • For Spring Boot 4, set useSpringBoot4=true (this automatically disables useSpringBoot3).
    • If adopting the default, ensure Java 17+ and Boot 3 dependencies.

Written for commit f5b29b9. Summary will update on new commits.

@wing328 wing328 changed the title Set useSpringBoot3 to true Set useSpringBoot3 to true by default Mar 23, 2026
@wing328 wing328 changed the title Set useSpringBoot3 to true by default Use Spring Boot 3.x by default (useSpringBoot3=true) Mar 23, 2026
@wing328 wing328 added this to the 7.21.0 milestone Mar 23, 2026
@wing328 wing328 marked this pull request as ready for review March 23, 2026 11:04
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

1 issue found across 1565 files

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java">

<violation number="1" location="modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java:524">
P3: The new Boot 4 auto-disable logic makes the following `useSpringBoot3 && useSpringBoot4` check unreachable, leaving dead conditional code.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@wing328 wing328 merged commit b11dff7 into master Mar 23, 2026
65 checks passed
@wing328 wing328 deleted the springboot3default branch March 23, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant