Upgrade to Spring Boot 3.2.5 and Java 17#23
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
- Bump spring-boot-starter-parent from 2.0.2.RELEASE to 3.2.5 (pom.xml) - Bump spring-boot-gradle-plugin to 3.2.5 (build.gradle) - Bump Gradle wrapper to 8.5 (required by Spring Boot 3.x) - Set java.version / sourceCompatibility / targetCompatibility to 17 - Replace deprecated Gradle configurations (compile -> implementation, testCompile -> testImplementation) and add the missing spring-boot-starter-jdbc and h2 deps so build.gradle matches pom.xml - Replace bootJar baseName/version with archiveBaseName/archiveVersion - Drop spring-boot-properties-migrator (was for the 1.x -> 2.x migration) - Fix H2 SQL: 'DROP TABLE customers IF EXISTS' -> 'DROP TABLE IF EXISTS customers' - Fix deprecated JdbcTemplate.query overload (RowMapper before varargs) - Remove dead http://gturnquist-quoters.cfapps.io/api/random calls, the RestTemplate bean, the CommandLineRunner bean, and the now-unused Quote / Value model classes - Update README.md prerequisites to Java 17 / Spring Boot 3.x - Add target/, build/, .gradle/ to .gitignore and remove stale build artifacts that were checked in Co-Authored-By: benc <Benc@windsurf.com>
Author
🤖 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:
|
Author
Runtime test results — all 11 tests passedI booted
Key evidence — startup log proves the H2 + JdbcTemplate fixes (click to expand)These two Topic CRUD round-trip evidenceNotes / things I did NOT test
Devin session: https://app.devin.ai/sessions/9025b18a88794071956d8a9761324e2b |
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
Upgrades the project from Spring Boot 2.0.2.RELEASE / Java 8 to Spring Boot 3.2.5 / Java 17, plus the related code fixes that the upgrade requires.
Build configuration
pom.xml: bumpspring-boot-starter-parentto3.2.5, set<java.version>17</java.version>, drop the obsoletespring-boot-properties-migrator(was only needed for the 1.x → 2.x migration)build.gradle: bumpspring-boot-gradle-pluginto3.2.5, setsourceCompatibility/targetCompatibilityto17, replace deprecatedcompile/testCompilewithimplementation/testImplementation, addspring-boot-starter-jdbc+h2so it matchespom.xml, and replace the removedbootJar { baseName / version }properties witharchiveBaseName/archiveVersiongradle/wrapper/gradle-wrapper.properties: bump the wrapper from Gradle 4.6 to 8.5 (required for Spring Boot 3.x);gradlewis now executableCode fixes in
src/main/java/hello/Application.javaDROP TABLE customers IF EXISTS→DROP TABLE IF EXISTS customers(H2 2.x dropped the legacy syntax)JdbcTemplate.query(...)to theRowMapper-before-varargs overload, replacing the deprecatedObject[]-args formhttp://gturnquist-quoters.cfapps.io/api/randomcalls (both the one inmainand theCommandLineRunnerrunbean), theRestTemplatebean, and the unusedRestTemplateBuilderimporthello.model.Quoteandhello.model.ValueclassesDocs / hygiene
README.md: prerequisites updated to Java 17 SDK and a note that the project now targets Spring Boot 3.x.gitignore: ignoretarget/,build/,.gradle/; the previously-committed staletarget/classes/*.classartifacts (which were compiled against Java 8 / Spring Boot 2 and no longer match the source) are removed.src/main/resources/public/index.htmlis the real welcome-page source and is unaffectedVerification
Both build systems succeed locally on Java 17:
JAVA_HOME=java-17 mvn -B clean package→BUILD SUCCESS(Maven 3.6.3)JAVA_HOME=java-17 ./gradlew --no-daemon build→BUILD SUCCESSFUL(Gradle 8.5)The packaged Gradle jar (
build/libs/gs-spring-boot-0.1.0.jar) was started with Java 17 and:Spring Boot :: (v3.2.5)in the bannercustomersH2 table, batch-inserted the four rows, and queried the twoJosh*rows back through the newJdbcTemplate.query(..., rowMapper, args...)signature —Customer{id=3, firstName='Josh', lastName='Bloch'}andCustomer{id=4, firstName='Josh', lastName='Long'}Review & Testing Checklist for Human
.github/workflows, so CI may be a separate concern)mvn clean packageand./gradlew buildon a clean checkout with JDK 17 set asJAVA_HOMEjava -jar build/libs/gs-spring-boot-0.1.0.jar, then exerciseGET /,GET /topic,GET /datetime,GET /topic/string/operation,GET /topic/file/operation— these existing endpoints were not touched but should be confirmed still work end-to-end on Spring Boot 3target/classes/*.classbuild artifacts; if you want them kept, I can revert that pieceNotes
pom.xmlpackaging ispom, which meansmvn packagedoes not produce a runnable jar. I left the packaging as-is because changing it is outside the scope of this upgrade. The Gradle build does produce a runnable jar inbuild/libs/, which is what I used to verify the app actually starts.javax.*imports exist insrc/, so nojavax→jakartachanges were required..pre-commit-config.yamlor.husky/is present in the repo, so no hook setup was needed.Link to Devin session: https://app.devin.ai/sessions/9025b18a88794071956d8a9761324e2b
Requested by: @bcmake
Devin Review