Upgrade multi-module Gradle project to Spring Boot 4.0.x#344
Merged
Upgrade multi-module Gradle project to Spring Boot 4.0.x#344
Conversation
Bumps gradle-wrapper from 9.4.0 to 9.4.1. --- updated-dependencies: - dependency-name: gradle-wrapper dependency-version: 9.4.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Bumps [gradle/actions](https://github.com/gradle/actions) from 5 to 6. - [Release notes](https://github.com/gradle/actions/releases) - [Commits](gradle/actions@v5...v6) --- updated-dependencies: - dependency-name: gradle/actions dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 5 to 6. - [Release notes](https://github.com/actions/configure-pages/releases) - [Commits](actions/configure-pages@v5...v6) --- updated-dependencies: - dependency-name: actions/configure-pages dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4 to 5. - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](actions/deploy-pages@v4...v5) --- updated-dependencies: - dependency-name: actions/deploy-pages dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Run org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0 recipe with manual fixes for root build version, thymeleaf-extras-springsecurity7, Spring Modulith BOM 2.0.5, and removal of hardcoded dependency versions. Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/53c726ed-2ba4-4f36-9516-fbd787a04e08 Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Spring Boot 4.0 split test autoconfigure annotations into separate modules. Add the corresponding modular test module as a testImplementation dependency to each subproject that uses a test slice annotation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Migrate imports to new packages: - DataJdbcTest -> org.springframework.boot.data.jdbc.test.autoconfigure - DataMongoTest -> org.springframework.boot.data.mongodb.test.autoconfigure - GraphQlTest -> org.springframework.boot.graphql.test.autoconfigure - JooqTest -> org.springframework.boot.jooq.test.autoconfigure DataJpaTest, WebMvcTest, and RestClientTest were already updated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
- Fix Jackson 3 ObjectMapper → JsonMapper type in batch modules - Fix Spring Batch DefaultBatchConfiguration → JdbcDefaultBatchConfiguration - Add spring-boot-jdbc dependency for DataSourceBuilder - Add modular test dependencies (data-jdbc-test, data-jpa-test, etc.) - Update test slice annotation imports to new Boot 4.0 packages - Fix TestEntityManager import and add spring-boot-jpa-test - Fix CacheAutoConfiguration and RedisAutoConfiguration imports - Replace testcontainers shaded Awaitility with direct Awaitility - Replace testcontainers shaded NumberUtils with inline implementation - Add explicit rest-assured version (removed from Boot 4.0 BOM) Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/53c726ed-2ba4-4f36-9516-fbd787a04e08 Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Contributor
Job Summary for GradleGradle Build :: gradle-build
|
Spring Batch 6 deprecated JobLauncherTestUtils in favor of JobOperatorTestUtils. Replace all usages of: - JobLauncherTestUtils → JobOperatorTestUtils - launcher.launchJob() → operator.startJob() Updated in both batch-rest-repository and batch-skip-step modules, including their documentation files. Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/f5cea9fa-8fbd-4861-8105-a701cd12b040 Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Contributor
Job Summary for GradleGradle Build :: gradle-build
|
Use the new API: .chunk(int).transactionManager(PlatformTransactionManager) instead of the deprecated .chunk(int, PlatformTransactionManager) in both batch-rest-repository and batch-skip-step modules. Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/308e35db-05f2-4c2e-893e-b25ca2e8ada4 Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Contributor
Job Summary for GradleGradle Build :: gradle-build
|
This was referenced Apr 19, 2026
…ional, and data-redis-cache - data-mongodb-tc-data-load: Change tools.jackson.core:jackson-databind (Jackson 3.x) to com.fasterxml.jackson.core:jackson-databind (Jackson 2.x) since Jackson2RepositoryPopulatorFactoryBean requires com.fasterxml.jackson.databind.ObjectMapper - data-mongodb-transactional: Add missing spring-boot-restclient dependency (provides RestTemplateBuilder) and enable MongoDB replica set for transaction support - data-redis-cache: Make CacheConfiguration public and directly import it in test to ensure @EnableCaching is processed before repository beans are created Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/22102f1f-2daa-4d79-b852-7bca32feab6d Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Contributor
Job Summary for GradleGradle Build :: gradle-build
|
- data-rest-validation: Add missing spring-boot-restclient dependency and replace ValidationError with local DTO (Spring Data REST 5.x made constructor private) - data-rest-composite-id: Restore @GeneratedValue on Author.Id.id field (erroneously removed by OpenRewrite recipe during Spring Boot 4 upgrade) Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/b0bdf128-5dc8-4e3a-a405-e09e45e57664 Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Contributor
Job Summary for GradleGradle Build :: gradle-build
|
Spring Data Redis 4.x defaults to asynchronous cache writes when a reactive Redis connection factory (Lettuce) is detected. This caused a race condition where cache.get() was called before the async put() completed. Fix by configuring RedisCacheWriter with immediateWrites(). Also switch test from @DataJpaTest to @SpringBootTest to ensure the full caching infrastructure (AOP advisors) wraps repository beans. Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/5eb808bd-5243-47dc-aebd-59fed1ce1871 Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
…and test-slice-tests-rest Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/2da16e0e-b1f7-4277-814b-f73c3d51450c Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
…st-slice-tests-rest - batch-rest-repository: Make external REST API URL configurable via `batch.users.resource` property and provide local test JSON fixture so the test doesn't depend on network access to jsonplaceholder.typicode.com - test-rest-assured: Upgrade rest-assured from 5.5.2 to 6.0.0 which natively supports Groovy 5.x (shipped by Spring Boot 4.0) - test-slice-tests-rest: Add missing spring-boot-restclient dependency needed by TestRestTemplate's RestTemplateBuilder Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/2da16e0e-b1f7-4277-814b-f73c3d51450c Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
Contributor
Job Summary for GradleGradle Build :: code-quality
|
Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/8dd962d4-950a-4a84-abc0-b0d7abc62cd9 Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Upgrades the multi-module Gradle project to Spring Boot 4.0.5 and applies the related ecosystem migrations (test slices, Testcontainers 2.x, Spring Batch 6, updated module dependencies, and doc/workflow updates).
Changes:
- Bump Spring Boot plugin to
4.0.5across submodules and adjust starters to the new modularized artifacts (e.g.,webmvc,restclient,*-test). - Migrate tests for Boot 4 package changes (test slices,
TestRestTemplate), and update Testcontainers coordinates/packages. - Refresh docs, badges, Gradle wrapper, and GitHub Actions workflows to align with the upgrade.
Reviewed changes
Copilot reviewed 96 out of 98 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web-thymeleaf-xss/src/test/java/zin/rashidi/web/xss/greet/GreetResourceTests.java | Updates @WebMvcTest import for Boot 4 test package move |
| web-thymeleaf-xss/build.gradle.kts | Bumps Boot, switches to webmvc and new Boot test starters |
| web-rest-client/src/test/java/zin/rashidi/boot/web/restclient/user/UserRepositoryTests.java | Migrates RestClient slice + Jackson 3 coordinates/imports |
| web-rest-client/src/test/java/zin/rashidi/boot/web/restclient/post/PostRepositoryTests.java | Migrates RestClient slice + Jackson 3 coordinates/imports |
| web-rest-client/build.gradle.kts | Adds modular restclient/webmvc starters and restclient test starter |
| test-slice-tests-rest/src/test/java/zin/rashidi/boot/test/slices/user/UserResourceTests.java | Updates @WebMvcTest import for Boot 4 test package move |
| test-slice-tests-rest/src/test/java/zin/rashidi/boot/test/slices/user/UserRepositoryTests.java | Updates @DataJpaTest import + Testcontainers 2 package/typed container changes |
| test-slice-tests-rest/src/test/java/zin/rashidi/boot/test/slices/user/FindByUsernameTests.java | Migrates TestRestTemplate to new package + adds auto-config annotation |
| test-slice-tests-rest/src/test/java/zin/rashidi/boot/test/slices/TestcontainersConfiguration.java | Updates PostgreSQL container package and type usage |
| test-slice-tests-rest/build.gradle.kts | Updates starters and Testcontainers artifacts for Boot 4 / TC 2 |
| test-rest-assured/src/test/java/zin/rashidi/boot/test/restassured/user/FindUserByUsernameTests.java | Updates MongoDB container package and HttpComponents status constants |
| test-rest-assured/src/test/java/zin/rashidi/boot/test/restassured/user/DeleteUserTests.java | Updates MongoDB container package and HttpComponents status constants |
| test-rest-assured/src/test/java/zin/rashidi/boot/test/restassured/user/CreateUserTests.java | Updates MongoDB container package and HttpComponents status constants |
| test-rest-assured/src/test/java/zin/rashidi/boot/test/restassured/TestTestRestAssuredApplication.java | Updates MongoDB container package |
| test-rest-assured/src/main/java/zin/rashidi/boot/test/restassured/user/UserReadOnly.java | Migrates Jackson imports to Jackson 3 (tools.jackson) |
| test-rest-assured/build.gradle.kts | Bumps Boot, switches to webmvc, upgrades rest-assured, updates TC artifacts |
| test-execution-listeners/src/test/java/zin/rashidi/boot/test/user/UserRepositoryTests.java | Updates @DataMongoTest import and MongoDB container package |
| test-execution-listeners/build.gradle.kts | Bumps Boot, updates TC artifacts, adds Boot modular test dep |
| supplemental-ui/partials/footer-content.hbs | Updates displayed Spring Boot version badge |
| modulith/src/test/java/zin/rashidi/boot/modulith/TestcontainersConfiguration.java | Updates PostgreSQL container package and type usage |
| modulith/docs/module-subscription.puml | Updates diagram styling/layout |
| modulith/docs/module-student.puml | Updates diagram styling/layout |
| modulith/docs/module-course.puml | Updates diagram styling/layout |
| modulith/docs/components.puml | Updates diagram styling/layout |
| modulith/build.gradle.kts | Bumps Boot, upgrades Spring Modulith BOM, updates TC artifacts |
| jooq/src/test/java/zin/rashidi/boot/jooq/user/UserRepositoryTests.java | Updates @JooqTest import + MySQL container package/type |
| jooq/src/test/java/zin/rashidi/boot/jooq/TestJooqApplication.java | Updates MySQL container package/type |
| jooq/build.gradle.kts | Bumps Boot, adds Boot jOOQ test module, updates TC artifacts |
| graphql/src/test/java/zin/rashidi/boot/graphql/book/BookResourceTests.java | Updates @GraphQlTest import for Boot 4 test package move |
| graphql/build.gradle.kts | Bumps Boot, switches to webmvc, adds Boot GraphQL test module |
| gradlew | Updates referenced Gradle template commit URL |
| gradle/wrapper/gradle-wrapper.properties | Updates Gradle wrapper distribution to 9.4.1 |
| docs/modules/ROOT/pages/batch-skip-step.adoc | Updates docs for Spring Batch test operator usage |
| docs/modules/ROOT/pages/batch-rest-repository.adoc | Updates docs for Spring Batch test operator usage |
| data-rest-validation/src/test/java/zin/rashidi/boot/data/rest/book/CreateBookTests.java | Migrates TestRestTemplate, adds local validation error DTO |
| data-rest-validation/src/test/java/zin/rashidi/boot/data/rest/TestDataRestValidationApplication.java | Updates container packages/types |
| data-rest-validation/build.gradle.kts | Bumps Boot, adds restclient/resttestclient modules, updates TC artifacts |
| data-rest-composite-id/src/test/java/zin/rashidi/datarest/compositeid/book/GetBookTests.java | Updates @AutoConfigureMockMvc import for Boot 4 package move |
| data-rest-composite-id/src/test/java/zin/rashidi/datarest/compositeid/book/CreateBookTests.java | Updates @AutoConfigureMockMvc import for Boot 4 package move |
| data-rest-composite-id/src/test/java/zin/rashidi/datarest/compositeid/book/CreateAuthorTests.java | Updates @AutoConfigureMockMvc import and removes shaded commons usage |
| data-rest-composite-id/src/test/java/zin/rashidi/datarest/compositeid/TestcontainersConfiguration.java | Updates PostgreSQL container package/type |
| data-rest-composite-id/build.gradle.kts | Bumps Boot, adds webmvc test starter, updates TC artifacts |
| data-repository-definition/src/test/java/zin/rashidi/data/repositorydefinition/note/NoteRepositoryTests.java | Updates @DataJdbcTest import for Boot 4 test package move |
| data-repository-definition/src/test/java/zin/rashidi/data/repositorydefinition/TestcontainersConfiguration.java | Updates PostgreSQL container package/type |
| data-repository-definition/build.gradle.kts | Bumps Boot, adds Boot data-jdbc test module, updates TC artifacts |
| data-redis-cache/src/test/java/zin/rashidi/dataredis/cache/customer/CustomerRepositoryTests.java | Switches test to @SpringBootTest and simplifies configuration |
| data-redis-cache/src/test/java/zin/rashidi/dataredis/cache/TestcontainersConfiguration.java | Updates PostgreSQL container package/type |
| data-redis-cache/src/main/java/zin/rashidi/dataredis/cache/cache/CacheConfiguration.java | Updates Redis cache manager creation approach (writer/immediate writes) |
| data-redis-cache/build.gradle.kts | Bumps Boot, adds Boot modular deps for cache/redis + updates TC artifacts |
| data-mongodb-transactional/src/test/java/zin/rashidi/boot/data/mongodb/tm/user/CreateUserTests.java | Migrates TestRestTemplate, updates MongoDB container setup |
| data-mongodb-transactional/build.gradle.kts | Bumps Boot, switches to webmvc, adds restclient modules, updates TC artifacts |
| data-mongodb-tc-data-load/src/test/java/zin/rashidi/data/mongodb/tc/dataload/user/UserRepositoryTests.java | Updates @DataMongoTest import and MongoDB container package |
| data-mongodb-tc-data-load/build.gradle.kts | Bumps Boot, adds Boot data-mongodb test module, updates TC artifacts |
| data-mongodb-full-text-search/src/test/java/zin/rashidi/boot/data/mongodb/character/CharacterRepositoryTests.java | Updates @DataMongoTest import and MongoDB container package |
| data-mongodb-full-text-search/build.gradle.kts | Bumps Boot, adds Boot data-mongodb test module, updates TC artifacts |
| data-mongodb-audit/src/test/java/zin/rashidi/boot/data/mongodb/user/UserAuditTests.java | Switches Awaitility import away from shaded TC, updates Mongo test slice import |
| data-mongodb-audit/build.gradle.kts | Bumps Boot, adds Boot data-mongodb test module, updates TC artifacts |
| data-jpa-hibernate-cache/src/test/java/zin/rashidi/datajpa/hibernatecache/customer/CustomerRepositoryTests.java | Updates @DataJpaTest import for Boot 4 test package move |
| data-jpa-hibernate-cache/src/test/java/zin/rashidi/datajpa/hibernatecache/TestcontainersConfiguration.java | Updates PostgreSQL container package/type |
| data-jpa-hibernate-cache/build.gradle.kts | Bumps Boot, adjusts Ehcache dependency notation, updates test deps/TC artifacts |
| data-jpa-filtered-query/src/test/java/zin/rashidi/boot/data/jpa/user/UserRepositoryTests.java | Updates @DataJpaTest import and MySQL container package/type |
| data-jpa-filtered-query/src/test/java/zin/rashidi/boot/data/jpa/country/CountryRepositoryTests.java | Updates @DataJpaTest import and MySQL container package/type |
| data-jpa-filtered-query/src/test/java/zin/rashidi/boot/data/jpa/TestDataJpaFilteredQueryApplication.java | Updates MySQL container package/type |
| data-jpa-filtered-query/build.gradle.kts | Bumps Boot, adds Boot data-jpa test starter, updates TC artifacts |
| data-jpa-event/src/test/java/zin/rashidi/data/event/user/UserRepositoryTests.java | Updates JPA test imports + PostgreSQL container package/type |
| data-jpa-event/src/test/java/zin/rashidi/data/event/TestcontainersConfiguration.java | Updates PostgreSQL container package/type |
| data-jpa-event/build.gradle.kts | Bumps Boot, adds Boot data-jpa test starter, updates TC artifacts |
| data-jpa-audit/src/test/java/zin/rashidi/boot/data/user/UserAuditTests.java | Updates @DataJpaTest import and MySQL container package/type |
| data-jpa-audit/build.gradle.kts | Bumps Boot, adds Boot data-jpa test starter, updates TC artifacts |
| data-jdbc-schema-generation/src/test/java/zin/rashidi/boot/jdbcscgm/book/BookRepositoryTests.java | Updates @DataJdbcTest import for Boot 4 test package move |
| data-jdbc-schema-generation/src/test/java/zin/rashidi/boot/jdbcscgm/TestcontainersConfiguration.java | Updates PostgreSQL container package/type |
| data-jdbc-schema-generation/build.gradle.kts | Bumps Boot, switches to Liquibase starter, adds Boot data-jdbc test module |
| data-jdbc-audit/src/test/java/zin/rashidi/boot/data/jdbc/user/UserAuditTests.java | Updates @DataJdbcTest import and PostgreSQL container package/type |
| data-jdbc-audit/src/test/java/zin/rashidi/boot/data/jdbc/TestcontainersConfiguration.java | Updates PostgreSQL container package/type |
| data-jdbc-audit/build.gradle.kts | Bumps Boot, adds Boot data-jdbc test module, updates TC artifacts |
| data-envers-audit/src/test/java/zin/rashidi/boot/data/envers/BookAuditRevisionTests.java | Updates MySQL container package/type |
| data-envers-audit/build.gradle.kts | Bumps Boot, updates TC artifacts |
| data-domain-events/src/test/java/zin/rashidi/boot/data/de/availability/BookPurchaseTests.java | Migrates TestRestTemplate and adds auto-config annotation |
| data-domain-events/src/test/java/zin/rashidi/boot/data/de/TestDataDomainEventsApplication.java | Updates MySQL container package/type |
| data-domain-events/build.gradle.kts | Bumps Boot, switches to webmvc, adds restclient modules, updates TC artifacts |
| cloud-jdbc-env-repo/src/test/resources/META-INF/spring.factories | Adds bootstrap configuration entries for tests |
| cloud-jdbc-env-repo/src/test/java/zin/rashidi/boot/cloud/jdbcenvrepo/CloudJdbcEnvRepoApplicationTests.java | Migrates TestRestTemplate and MySQL container package/type |
| cloud-jdbc-env-repo/build.gradle.kts | Bumps Boot, bumps Spring Cloud BOM, updates test dependencies |
| build.gradle.kts | Bumps root Boot plugin version to 4.0.5 |
| batch-skip-step/src/test/java/zin/rashidi/boot/batch/user/UserBatchJobTests.java | Updates Spring Batch 6 test utilities + TC 2 + Awaitility import |
| batch-skip-step/src/main/java/zin/rashidi/boot/batch/user/UserJobConfiguration.java | Migrates Spring Batch 6 APIs + Jackson 3 mapper + chunk config API |
| batch-skip-step/build.gradle.kts | Bumps Boot, migrates Jackson dependency coordinates, updates TC artifacts |
| batch-skip-step/README.adoc | Updates docs for Spring Batch test operator usage |
| batch-rest-repository/src/test/resources/users.json | Adds local JSON fixture for batch job tests |
| batch-rest-repository/src/test/java/zin/rashidi/boot/batch/rest/user/UserBatchJobTests.java | Updates Spring Batch 6 test utilities, adds property-driven input resource |
| batch-rest-repository/src/main/java/zin/rashidi/boot/batch/rest/user/UserJobConfiguration.java | Makes external users resource configurable + migrates Spring Batch/Jackson APIs |
| batch-rest-repository/build.gradle.kts | Bumps Boot, migrates Jackson dependency coordinates, updates test deps/TC artifacts |
| batch-rest-repository/README.adoc | Updates docs for Spring Batch test operator usage |
| README.adoc | Updates badge and referenced Spring Boot version |
| .github/workflows/gradle-build.yml | Updates Gradle GitHub Actions versions |
| .github/workflows/copilot-setup-steps.yml | Adds a workflow for Copilot setup steps |
| .github/workflows/build-and-publish-antora.yml | Updates GitHub Pages actions versions |
Comments suppressed due to low confidence (3)
web-thymeleaf-xss/build.gradle.kts:1
thymeleaf-extras-springsecurity6is unlikely to be compatible with Spring Boot 4 / Spring Security 7. Update this dependency to the Spring Security 7 compatible artifact (thymeleaf-extras-springsecurity7) to avoid classpath/runtime incompatibilities.
test-slice-tests-rest/src/test/java/zin/rashidi/boot/test/slices/user/UserRepositoryTests.java:1- This uses a raw
PostgreSQLContainertype, which will introduce unchecked/rawtype warnings and lose type-safety. Prefer keeping the wildcard generic (PostgreSQLContainer<?>) (or the appropriate self-referential generic type) unless Testcontainers 2 removed the generics for this container type.
data-redis-cache/src/test/java/zin/rashidi/dataredis/cache/customer/CustomerRepositoryTests.java:1 - Switching from a slice test (
@DataJpaTest+ minimal auto-config) to@SpringBootTestloads the full application context and can significantly slow down the test suite/CI. If the only goal is to re-enable caching with Boot 4, consider staying with a slice test and explicitly importing/auto-configuring the required caching/Redis pieces to keep test startup time low.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nRepositoryPopulatorFactoryBean Switch data-mongodb-tc-data-load from Jackson 2 (com.fasterxml.jackson.core:jackson-databind) to Jackson 3 (tools.jackson.core:jackson-databind) and use the non-deprecated JacksonRepositoryPopulatorFactoryBean in tests. Agent-Logs-Url: https://github.com/rashidi/spring-boot-tutorials/sessions/8dd962d4-950a-4a84-abc0-b0d7abc62cd9 Co-authored-by: rashidi <380073+rashidi@users.noreply.github.com>
|
rashidi
approved these changes
Apr 19, 2026
Copilot stopped work on behalf of
rashidi due to an error
April 19, 2026 10:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Jackson2RepositoryPopulatorFactoryBeanwithJacksonRepositoryPopulatorFactoryBean(Jackson 3) indata-mongodb-tc-data-loadtestcom.fasterxml.jackson.core:jackson-databind(Jackson 2) totools.jackson.core:jackson-databind(Jackson 3) in build.gradle.ktsgradlew check— all 169 tasks passOriginal prompt
Objective
Upgrade the entire multi-module Gradle project from Spring Boot 3.5.7 to Spring Boot 4.0.x using the OpenRewrite recipe
org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0.Steps
1. Add OpenRewrite plugin to root
build.gradle.ktsAdd the OpenRewrite Gradle plugin and the
rewrite-springrecipe dependency to the root build file:plugins { id("org.openrewrite.rewrite") version "7.6.4" } rewrite { activeRecipe("org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0") } dependencies { rewrite("org.openrewrite.recipe:rewrite-spring:6.29.0") }2. Run
./gradlew rewriteRunThis will apply all necessary changes across all 27 submodules.
3. Expected automated changes the recipe should produce
The recipe should handle all of the following. Verify each is applied:
3.5.7→4.0.xin allbuild.gradle.ktsfiles (root + 27 submodules)spring-boot-starter-web→spring-boot-starter-webmvcin:graphql,web-thymeleaf-xss,data-domain-events,web-rest-client,data-mongodb-transactional,test-rest-assured,test-slice-tests-rest, and any othersthymeleaf-extras-springsecurity6→thymeleaf-extras-springsecurity7inweb-thymeleaf-xssbatch-rest-repository,batch-skip-step,test-slice-tests-restweb-thymeleaf-xss,test-slice-tests-restapplication.properties/application.ymlfiles@MockBean/@SpyBean→@MockitoBean/@MockitoSpyBeanif any are foundbatch-rest-repositoryandbatch-skip-stepexplicitly depend oncom.fasterxml.jackson.core:jackson-databind; Jackson 3 uses new coordinates4. Manual verification after recipe run
io.spring.dependency-managementplugin version is compatible with Boot 4.0 (update if needed)spring-boot-starter-data-restindata-rest-validationanddata-rest-composite-idis still valid or renamedorg.sonarqubeplugin version is still compatible./gradlew build5. Clean up
After the recipe has been run and changes verified, remove the OpenRewrite plugin configuration from
build.gradle.ktssince it was only needed for the one-time migration.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Identify necessary changes to upgrade the project from Spring Boot 3.x to Spring Boot 4.x using OpenRewrite
Assistant: Now let me check a few representative subproject build files to understand the full dependency landscape:
Assistant: Now I have a comprehensive picture of the repository. Here's the analysis:
Spring Boot 3.x → 4.x Upgrade Analysis for
rashidi/spring-boot-tutorialsCurrent State
3.5.7(all 27 submodules)25io.spring.dependency-management1.1.7Recommended OpenRewrite Recipe
Use the
org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0recipe. Add the OpenRewrite Gradle plugin to your rootbuild.gradle.kts:plugins { id("org.openrewrite.rewrite") version "7.6.4" } rewrite { activeRecipe("org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0") } dependencies { rewrite("org.openrewrite.recipe:rewrite-spring:6.29.0") }Then run:
Key Changes the Recipe Will Handle (and what to watch for in this repo)
1. Spring Boot version bump (
3.5.7→4.0.x)All 27 submodule
build.gradle.ktsfiles declareversion "3.5.7"— all will be updated.2. Starter renames —
spring-boot-starter-web→spring-boot-starter-webmvcAffects 8 submodules:
graphql,web-thymeleaf-xss,data-domain-events,web-rest-client,data-mongodb-transactional,test-rest-assured,test-slice-tests-rest, and likely more. The recipe handles this viaMigrateToModularStarters.3.
thymeleaf-extras-springsecurity6→thymeleaf-extras-springsecurity7Affects
web-thymeleaf-xss— the Spring Security 7 upgrade recipe will handle this rename.4. Spring Batch 5 → 6 migration
Affects
batch-rest-repository,batch-skip-step, andtest-slice-tests-rest(which usesspring-batch-test). The recipe includesSpringBatch5To6Migrationwhich handles API changes.5. Testcontainers 1.x → 2.x migration
Affects most submodules using
org.testcontainers:*. The recipe includesTestcontainers2Migration.6. Hibernate → 7.1 migration
Affects all JPA-based submodules (
data-jpa-*,data-envers-audit, `data-rest...This pull request was created from Copilot chat.