Upgrade to Spring Boot 4.0.3, Java 25, Gradle 9.3.1 and modernize codebase#114
Open
dcaron wants to merge 2 commits intocloudfoundry-samples:masterfrom
Open
Upgrade to Spring Boot 4.0.3, Java 25, Gradle 9.3.1 and modernize codebase#114dcaron wants to merge 2 commits intocloudfoundry-samples:masterfrom
dcaron wants to merge 2 commits intocloudfoundry-samples:masterfrom
Conversation
…ebase Backend / build: - Upgrade Spring Boot 3.1.5 → 4.0.3 and Java CFEnv 3.1.2 → 4.0.0 - Upgrade Java 17 → 25 and Gradle 7.6.2 → 9.3.1 - Remove io.spring.dependency-management plugin (Spring Boot 4 Gradle plugin handles the BOM natively) - Update Spring Boot 4 auto-configuration class names in SpringApplicationContextInitializer (boot.data.*, boot.jdbc.*, boot.mongodb.*) - Switch logger from Apache Commons Logging to SLF4J - Replace Collections.singletonList/Map with List.of/Map.of - Replace deprecated @GenericGenerator + @GeneratedValue with @uuidgenerator (Hibernate 6 native API; same UUID behaviour) - Fix Hibernate dialects: MySQL55Dialect → MySQLDialect, ProgressDialect → PostgreSQLDialect - Fix MySQL JDBC driver class: com.mysql.jdbc.Driver → com.mysql.cj.jdbc.Driver - Replace Jackson2ResourceReader (removed in Spring Data 3) with direct ObjectMapper.readValue in AlbumRepositoryPopulator - Replace Jackson2JsonRedisSerializer (removed) with a custom RedisSerializer backed by Jackson 3 (tools.jackson) in RedisConfig - Migrate tests from JUnit 4 (@RunWith) to JUnit 5; add useJUnitPlatform() - Replace @RequestMapping(method=RequestMethod.*) with @GetMapping, @PostMapping, @PutMapping, @DeleteMapping in AlbumController - Replace manual convertIterableToList() with StreamSupport.stream().toList() - Update manifest.yml: add java_buildpack_offline, bump JRE to 25.+ Frontend (WebJars): - AngularJS 1.2.16 → 1.8.3 (final 1.x release) - Bootstrap 3.1.1 → 3.4.1 (final Bootstrap 3 patch) - jQuery 2.1.0 → 3.7.1 (security update) - angular-ui-bootstrap 0.10.0 → 0.14.3 (final 0.x; $modal API unchanged) - angular-ui 0.4.0-2 → 0.4.0-3 Tested on Cloud Foundry (TAS) with PostgreSQL, MySQL, and Redis backends. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update Java requirement 17 → 25 - Add tech stack version table (Java 25, Spring Boot 4.0.3, Gradle 9.3.1, Java CFEnv 4.0.0) - Fix all http:// links to https:// and update stale Spring Boot doc URLs - Update Oracle driver instructions: compile → implementation (Gradle modern syntax) - Update "Alternate Java versions" section to reference VERSION_25 - Minor wording fixes (its, H2 in-memory, cloudfoundry.org URL) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
This PR brings the app up to the current latest stack while preserving its core purpose: demoing the same Spring Boot application on multiple database backends (H2, MySQL, PostgreSQL, MongoDB, Redis) on Cloud Foundry.
Backend / Build
io.spring.dependency-managementplugin — Spring Boot 4's Gradle plugin manages the BOM nativelySpringApplicationContextInitializer(boot.data.*,boot.jdbc.*,boot.mongodb.*)Collections.singletonList/MapwithList.of/Map.of@GenericGenerator+@GeneratedValuewith@UuidGenerator(Hibernate 6 native; same UUID behaviour)MySQL55Dialect→MySQLDialect,ProgressDialect(broken) →PostgreSQLDialectcom.mysql.jdbc.Driver→com.mysql.cj.jdbc.DriverJackson2ResourceReader(removed in Spring Data 3) with directObjectMapper.readValueinAlbumRepositoryPopulatorJackson2JsonRedisSerializer(removed) with a customRedisSerializerbacked by Jackson 3 (tools.jackson) inRedisConfig@RunWith) to JUnit 5; adduseJUnitPlatform()@RequestMapping(method=RequestMethod.*)with@GetMapping,@PostMapping,@PutMapping,@DeleteMappingconvertIterableToList()withStreamSupport.stream().toList()manifest.yml: explicitjava_buildpack_offline, bump JRE to25.+Frontend (WebJars)
$modalAPI unchanged)AngularJS is kept at 1.x and Bootstrap at 3.x to avoid breaking the existing templates and
$modal-based album form.Test plan
./gradlew clean testpasses (JUnit 5, H2 in-memory)cf push+ PostgreSQL service bound → 29 albums loaded, CRUD works, health UPcf push+ MySQL service bound → 29 albums loaded, health reports MySQL UPcf push+ Redis service bound → 29 albums loaded, health reports redis UPTested on TAS (Tanzu Application Service) with
java_buildpack_offline v4.86.0and OpenJDK JRE 25.0.1.🤖 Generated with Claude Code