Skip to content

Upgrade multi-module Gradle project to Spring Boot 4.0.x#344

Merged
rashidi merged 23 commits intomasterfrom
copilot/upgrade-spring-boot-to-4-0
Apr 19, 2026
Merged

Upgrade multi-module Gradle project to Spring Boot 4.0.x#344
rashidi merged 23 commits intomasterfrom
copilot/upgrade-spring-boot-to-4-0

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

  • Replace deprecated Jackson2RepositoryPopulatorFactoryBean with JacksonRepositoryPopulatorFactoryBean (Jackson 3) in data-mongodb-tc-data-load test
  • Switch com.fasterxml.jackson.core:jackson-databind (Jackson 2) to tools.jackson.core:jackson-databind (Jackson 3) in build.gradle.kts
  • Run regression test with gradlew check — all 169 tasks pass
Original 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.kts

Add the OpenRewrite Gradle plugin and the rewrite-spring recipe 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 rewriteRun

This 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:

  • Spring Boot version: 3.5.74.0.x in all build.gradle.kts files (root + 27 submodules)
  • Starter renames: spring-boot-starter-webspring-boot-starter-webmvc in: graphql, web-thymeleaf-xss, data-domain-events, web-rest-client, data-mongodb-transactional, test-rest-assured, test-slice-tests-rest, and any others
  • thymeleaf-extras-springsecurity6thymeleaf-extras-springsecurity7 in web-thymeleaf-xss
  • Spring Batch 5 → 6 API changes in batch-rest-repository, batch-skip-step, test-slice-tests-rest
  • Testcontainers 1.x → 2.x migration across ~14 modules
  • Hibernate → 7.1 migration for all JPA modules
  • Spring Security 7 changes in web-thymeleaf-xss, test-slice-tests-rest
  • Spring Boot property renames in any application.properties / application.yml files
  • @MockBean/@SpyBean@MockitoBean/@MockitoSpyBean if any are found
  • Jackson 3 migrationbatch-rest-repository and batch-skip-step explicitly depend on com.fasterxml.jackson.core:jackson-databind; Jackson 3 uses new coordinates

4. Manual verification after recipe run

  • Ensure io.spring.dependency-management plugin version is compatible with Boot 4.0 (update if needed)
  • Verify spring-boot-starter-data-rest in data-rest-validation and data-rest-composite-id is still valid or renamed
  • Ensure org.sonarqube plugin version is still compatible
  • Make sure the project compiles: ./gradlew build

5. Clean up

After the recipe has been run and changes verified, remove the OpenRewrite plugin configuration from build.gradle.kts since 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-tutorials

Current State

  • Spring Boot: 3.5.7 (all 27 submodules)
  • Java toolchain: 25
  • Build system: Gradle Kotlin DSL (multi-module)
  • Dependency Management Plugin: io.spring.dependency-management 1.1.7

Recommended OpenRewrite Recipe

Use the org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0 recipe. Add the OpenRewrite Gradle plugin to your root build.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:

./gradlew rewriteRun

Key Changes the Recipe Will Handle (and what to watch for in this repo)

1. Spring Boot version bump (3.5.74.0.x)

All 27 submodule build.gradle.kts files declare version "3.5.7" — all will be updated.

2. Starter renames — spring-boot-starter-webspring-boot-starter-webmvc

Affects 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 via MigrateToModularStarters.

3. thymeleaf-extras-springsecurity6thymeleaf-extras-springsecurity7

Affects 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, and test-slice-tests-rest (which uses spring-batch-test). The recipe includes SpringBatch5To6Migration which handles API changes.

5. Testcontainers 1.x → 2.x migration

Affects most submodules using org.testcontainers:*. The recipe includes Testcontainers2Migration.

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.

dependabot Bot and others added 8 commits April 18, 2026 07:31
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>
@github-actions
Copy link
Copy Markdown
Contributor

Job Summary for Gradle

Gradle Build :: gradle-build
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
spring-boot-tutorials check 9.4.1 Build Scan published

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>
@github-actions
Copy link
Copy Markdown
Contributor

Job Summary for Gradle

Gradle Build :: gradle-build
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
spring-boot-tutorials check 9.4.1 Build Scan published

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>
@github-actions
Copy link
Copy Markdown
Contributor

Job Summary for Gradle

Gradle Build :: gradle-build
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
spring-boot-tutorials check 9.4.1 Build Scan published

…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>
@github-actions
Copy link
Copy Markdown
Contributor

Job Summary for Gradle

Gradle Build :: gradle-build
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
spring-boot-tutorials check 9.4.1 Build Scan published

- 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>
@github-actions
Copy link
Copy Markdown
Contributor

Job Summary for Gradle

Gradle Build :: gradle-build
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
spring-boot-tutorials check 9.4.1 Build Scan published

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>
Copilot AI and others added 2 commits April 19, 2026 09:17
…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>
@github-actions
Copy link
Copy Markdown
Contributor

Job Summary for Gradle

Gradle Build :: code-quality
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
spring-boot-tutorials sonar 9.4.1 Build Scan published

@rashidi rashidi marked this pull request as ready for review April 19, 2026 09:36
@rashidi rashidi requested a review from Copilot April 19, 2026 09:36
@rashidi rashidi changed the title [WIP] Upgrade multi-module Gradle project to Spring Boot 4.0.x Upgrade multi-module Gradle project to Spring Boot 4.0.x Apr 19, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.5 across 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-springsecurity6 is 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 PostgreSQLContainer type, 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 @SpringBootTest loads 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.

Comment thread cloud-jdbc-env-repo/src/test/resources/META-INF/spring.factories
…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>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@rashidi rashidi merged commit 6edbd71 into master Apr 19, 2026
9 of 11 checks passed
@rashidi rashidi deleted the copilot/upgrade-spring-boot-to-4-0 branch April 19, 2026 10:03
Copilot stopped work on behalf of rashidi due to an error April 19, 2026 10:03
Copilot AI requested a review from rashidi April 19, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file java Pull requests that update Java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants