Skip to content

Upgrade to Spring Boot 3.2.5 and Java 17#23

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1777915307-spring-boot-3-java-17
Open

Upgrade to Spring Boot 3.2.5 and Java 17#23
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1777915307-spring-boot-3-java-17

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 4, 2026

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: bump spring-boot-starter-parent to 3.2.5, set <java.version>17</java.version>, drop the obsolete spring-boot-properties-migrator (was only needed for the 1.x → 2.x migration)
  • build.gradle: bump spring-boot-gradle-plugin to 3.2.5, set sourceCompatibility / targetCompatibility to 17, replace deprecated compile / testCompile with implementation / testImplementation, add spring-boot-starter-jdbc + h2 so it matches pom.xml, and replace the removed bootJar { baseName / version } properties with archiveBaseName / archiveVersion
  • gradle/wrapper/gradle-wrapper.properties: bump the wrapper from Gradle 4.6 to 8.5 (required for Spring Boot 3.x); gradlew is now executable

Code fixes in src/main/java/hello/Application.java

  • DROP TABLE customers IF EXISTSDROP TABLE IF EXISTS customers (H2 2.x dropped the legacy syntax)
  • Switched JdbcTemplate.query(...) to the RowMapper-before-varargs overload, replacing the deprecated Object[]-args form
  • Removed the dead http://gturnquist-quoters.cfapps.io/api/random calls (both the one in main and the CommandLineRunner run bean), the RestTemplate bean, and the unused RestTemplateBuilder import
  • Removed the now-unused hello.model.Quote and hello.model.Value classes

Docs / hygiene

  • README.md: prerequisites updated to Java 17 SDK and a note that the project now targets Spring Boot 3.x
  • .gitignore: ignore target/, build/, .gradle/; the previously-committed stale target/classes/*.class artifacts (which were compiled against Java 8 / Spring Boot 2 and no longer match the source) are removed. src/main/resources/public/index.html is the real welcome-page source and is unaffected

Verification

Both build systems succeed locally on Java 17:

  • JAVA_HOME=java-17 mvn -B clean packageBUILD SUCCESS (Maven 3.6.3)
  • JAVA_HOME=java-17 ./gradlew --no-daemon buildBUILD SUCCESSFUL (Gradle 8.5)

The packaged Gradle jar (build/libs/gs-spring-boot-0.1.0.jar) was started with Java 17 and:

  • Reported Spring Boot :: (v3.2.5) in the banner
  • Booted Tomcat 10.1.20 on port 8080
  • Created the customers H2 table, batch-inserted the four rows, and queried the two Josh* rows back through the new JdbcTemplate.query(..., rowMapper, args...) signature — Customer{id=3, firstName='Josh', lastName='Bloch'} and Customer{id=4, firstName='Josh', lastName='Long'}

Review & Testing Checklist for Human

  • Confirm CI passes on Java 17 for both Maven and Gradle paths (the repo had no .github/workflows, so CI may be a separate concern)
  • mvn clean package and ./gradlew build on a clean checkout with JDK 17 set as JAVA_HOME
  • Smoke test the running app: java -jar build/libs/gs-spring-boot-0.1.0.jar, then exercise GET /, 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 3
  • Confirm you're OK with deleting the previously-committed target/classes/*.class build artifacts; if you want them kept, I can revert that piece

Notes

  • pom.xml packaging is pom, which means mvn package does 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 in build/libs/, which is what I used to verify the app actually starts.
  • No javax.* imports exist in src/, so no javaxjakarta changes were required.
  • No .pre-commit-config.yaml or .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

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

- 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>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration
Copy link
Copy Markdown
Author

Runtime test results — all 11 tests passed

I booted build/libs/gs-spring-boot-0.1.0.jar on Java 17 from the repo root and exercised every existing REST endpoint plus the H2 startup demo. Shell-only testing (no GUI to record).

# Test Result
T1 Banner shows (v3.2.5), log shows Java 17, Tomcat/10.1.20, port 8080 ✅ passed
T2 H2 DDL: Creating tables + 4 customer inserts, no JdbcSQLSyntaxErrorException ✅ passed
T3 New JdbcTemplate.query(sql, RowMapper, args) overload returns Josh Bloch (id=3) and Josh Long (id=4) ✅ passed
T4 GET / → 200, JSON greeting, counter increments across calls ✅ passed
T5 GET /topic → 200, 3 seeded items, ids [spring, java, javascript] ✅ passed
T6 Topic CRUD round-trip: POST→GET→PUT→GET→DELETE→GET ✅ passed
T7 GET /topic/sort → ids ordered [java, javascript, spring] ✅ passed
T8 GET /topic/minimum/length/{4,9}[javascript, spring] and [javascript] ✅ passed
T9 GET /datetime → 200, all expected substrings, "tomorrow" = "now" + 1 day ✅ passed
T10 GET /topic/string/operation → 200, returns [spring] for "id has 'g'" filter ✅ passed
T11 GET /topic/file/operation → 200, Hello, this, is, Rehman (NOT IO exception) ✅ passed
Key evidence — startup log proves the H2 + JdbcTemplate fixes (click to expand)
 :: Spring Boot ::                (v3.2.5)
... Starting Application using Java 17.0.18 ...
... Starting Servlet engine: [Apache Tomcat/10.1.20]
... Tomcat started on port 8080 (http) with context path ''
... Started Application in 2.37 seconds ...
... hello.Application : Creating tables
... hello.Application : Inserting customer record for John Woo
... hello.Application : Inserting customer record for Jeff Dean
... hello.Application : Inserting customer record for Josh Bloch
... hello.Application : Inserting customer record for Josh Long
... hello.Application : Querying for customer records where first_name = 'Josh':
... hello.Application : Customer{id=3, firstName='Josh', lastName='Bloch'}
... hello.Application : Customer{id=4, firstName='Josh', lastName='Long'}

These two Customer{...} lines are the exact assertion the plan demanded — they prove BOTH the H2 2.x DDL fix (no syntax error blocking startup) AND the new JdbcTemplate.query(sql, RowMapper, args...) overload binding the ? placeholder correctly to "Josh".

Topic CRUD round-trip evidence
POST   /topic     → HTTP 200
GET    /topic/py  → 200 {"id":"py","subjectName":"Python","subjectDescription":"Python Description"}
PUT    /topic/py  → HTTP 200
GET    /topic/py  → 200 {"id":"py","subjectName":"Python 3","subjectDescription":"Updated"}
DELETE /topic/py  → HTTP 200
GET    /topic     → 200 (back to original 3 items: spring, java, javascript)

Notes / things I did NOT test

  • No unit tests exist in src/test/.
  • mvn package runtime jar — pom.xml uses <packaging>pom</packaging> so it doesn't emit a runnable jar; called out in the PR description. The Gradle jar is what was tested.
  • One small plan correction: the Topic POJO actually serializes as subjectName / subjectDescription (not name / description). I adjusted the assertions accordingly during execution. T5/T6 verified the real JSON contract.

Devin session: https://app.devin.ai/sessions/9025b18a88794071956d8a9761324e2b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants