Migrate to Java 17 + Spring Boot 3.2.5#26
Conversation
- Bump Java version from 1.8 to 17 in pom.xml, build.gradle, and gs-spring-boot.iml - Bump Spring Boot from 2.0.2.RELEASE to 3.2.5 (Maven parent and Gradle plugin) - Remove spring-boot-properties-migrator (1.x->2.x migration helper, no longer needed) - Update Maven wrapper to apache-maven 3.9.6 - Update Gradle wrapper to gradle 8.7 - Use modern Gradle 'implementation'/'testImplementation' (compile/testCompile removed) - Rename bootJar 'baseName' to 'archiveBaseName' for Gradle 8 compatibility - Add spring-boot-starter-jdbc and h2 to Gradle deps so it matches Maven and Application.java compiles - Fix H2 DDL syntax: 'DROP TABLE customers IF EXISTS' -> 'DROP TABLE IF EXISTS customers' - Replace deprecated JdbcTemplate.query(sql, Object[], RowMapper) with varargs overload Co-Authored-By: sophia.lyssy <sophia.lyssy@windsurf.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
The hard-coded http://gturnquist-quoters.cfapps.io URL is no longer reachable. Wrap both call sites in try/catch so the failed fetch only logs a warning instead of aborting Spring Boot startup, which was preventing the migrated app from serving any endpoints. Co-Authored-By: sophia.lyssy <sophia.lyssy@windsurf.com>
Test results — all primary endpoint checks passedBuilt the migrated project on Java 17, booted the resulting jar, watched startup logs, and hit every endpoint from the original spec. Heads-up (please read before merging)The original Results
Boot log highlights (click to expand)This log alone proves three migration-specific things at once: the Spring Boot 3.2.5 parent/plugin took effect (banner version), the new H2 Endpoint responses (click to expand)Tested by: Devin session |
Summary
Migrates the project from Java 8 / Spring Boot 2.0.2.RELEASE to Java 17 / Spring Boot 3.2.5, modernizes the build tooling, and fixes two Spring Boot 3.x compatibility issues in
Application.java.File-by-file changes
pom.xml<java.version>:1.8→172.0.2.RELEASE→3.2.5spring-boot-properties-migrator(only needed for 1.x→2.x; obsolete in 3.x)build.gradlesourceCompatibility/targetCompatibility:1.8→172.0.2.RELEASE→3.2.5compile(...)→implementation(...)andtestCompile(...)→testImplementation(...)(removed in modern Gradle)bootJar { baseName = ... }→archiveBaseName = ...(Gradle 8 compatibility)spring-boot-starter-jdbcand runtimecom.h2database:h2so the Gradle build matches the Maven dependency set andApplication.java(which usesJdbcTemplate) actually compilesgs-spring-boot.iml:LANGUAGE_LEVEL="JDK_1_8"→JDK_17.mvn/wrapper/maven-wrapper.properties: Apache Maven3.3.9→3.9.6gradle/wrapper/gradle-wrapper.properties: Gradle4.6→8.7src/main/java/hello/Application.javaDROP TABLE customers IF EXISTS→DROP TABLE IF EXISTS customers(standard SQL required by newer H2)jdbcTemplate.query(sql, Object[] args, RowMapper)overload with the varargs overloadjdbcTemplate.query(sql, RowMapper, args...)(still type-safe; no behavior change)Local verification
./mvnw clean package -DskipTests→ BUILD SUCCESS (Maven 3.9.6, Java 17). Note:pom.xmlhas<packaging>pom</packaging>, so the Maven build does not compile sources itself — Gradle is the build that compiles the Java sources../gradlew clean build --no-daemon→ BUILD SUCCESSFUL (Gradle 8.7, Java 17), producesbuild/libs/gs-spring-boot-0.1.0.jar.Review & Testing Checklist for Human
./gradlew clean buildlocally on Java 17 to confirm the jar builds../gradlew bootRun(orjava -jar build/libs/gs-spring-boot-0.1.0.jar) and hit each endpoint to verify behavior is unchanged:GET /(greeting)GET /datetimeGET /topicGET /topic/string/operationGET /topic/file/operationNotes
build.gradledid not declarespring-boot-starter-jdbc/h2, so it could not compileApplication.javaeven before this migration. I added them to keep the two build files (Maven and Gradle) consistent and to fulfill the "Gradle build should compile" requirement.pom.xmlkeeps<packaging>pom</packaging>(unchanged frommaster), somvndoes not produce a jar. Use Gradle to produce the runnable artifact.javax.*→jakarta.*rewrites were necessary — the source tree does not import anyjavax.*Spring/Servlet packages.Link to Devin session: https://app.devin.ai/sessions/0e0a7eebafba43b686ce210e93f85040
Requested by: @sophialyssy-sys
Devin Review