Skip to content

Migrate to Java 17 + Spring Boot 3.2.5#26

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1778534161-java17-springboot3-migration
Open

Migrate to Java 17 + Spring Boot 3.2.5#26
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1778534161-java17-springboot3-migration

Conversation

@devin-ai-integration
Copy link
Copy Markdown

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

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.817
    • Spring Boot parent: 2.0.2.RELEASE3.2.5
    • Removed spring-boot-properties-migrator (only needed for 1.x→2.x; obsolete in 3.x)
  • build.gradle
    • sourceCompatibility / targetCompatibility: 1.817
    • Spring Boot Gradle plugin: 2.0.2.RELEASE3.2.5
    • compile(...)implementation(...) and testCompile(...)testImplementation(...) (removed in modern Gradle)
    • bootJar { baseName = ... }archiveBaseName = ... (Gradle 8 compatibility)
    • Added spring-boot-starter-jdbc and runtime com.h2database:h2 so the Gradle build matches the Maven dependency set and Application.java (which uses JdbcTemplate) actually compiles
  • gs-spring-boot.iml: LANGUAGE_LEVEL="JDK_1_8"JDK_17
  • .mvn/wrapper/maven-wrapper.properties: Apache Maven 3.3.93.9.6
  • gradle/wrapper/gradle-wrapper.properties: Gradle 4.68.7
  • src/main/java/hello/Application.java
    • DROP TABLE customers IF EXISTSDROP TABLE IF EXISTS customers (standard SQL required by newer H2)
    • Replaced deprecated jdbcTemplate.query(sql, Object[] args, RowMapper) overload with the varargs overload jdbcTemplate.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.xml has <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), produces build/libs/gs-spring-boot-0.1.0.jar.

Review & Testing Checklist for Human

  • Run ./gradlew clean build locally on Java 17 to confirm the jar builds.
  • Run ./gradlew bootRun (or java -jar build/libs/gs-spring-boot-0.1.0.jar) and hit each endpoint to verify behavior is unchanged:
    • GET / (greeting)
    • GET /datetime
    • GET /topic
    • GET /topic/string/operation
    • GET /topic/file/operation
  • Confirm the application starts cleanly with no Spring Boot 3 deprecation/migration warnings related to removed properties.

Notes

  • The original build.gradle did not declare spring-boot-starter-jdbc / h2, so it could not compile Application.java even 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.xml keeps <packaging>pom</packaging> (unchanged from master), so mvn does not produce a jar. Use Gradle to produce the runnable artifact.
  • No javax.*jakarta.* rewrites were necessary — the source tree does not import any javax.* Spring/Servlet packages.

Link to Devin session: https://app.devin.ai/sessions/0e0a7eebafba43b686ce210e93f85040
Requested by: @sophialyssy-sys


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

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

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

Test results — all primary endpoint checks passed

Built 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 Application.java had a hard-coded fetch of http://gturnquist-quoters.cfapps.io/api/random inside a @Bean CommandLineRunner. That host no longer resolves, so on Spring Boot 3.x the runner threw UnknownHostException and aborted startup before Tomcat began serving any endpoint. To make the user-requested "verify endpoints work" check possible, I added a try { ... } catch (Exception e) { log.warn("Skipping demo quote fetch: {}", e.getMessage()); } around both call sites in commit 47f4e2b on this branch. This is a pre-existing issue unrelated to the migration itself; flagging it so it's not a surprise during review.

Results

# Check Result
1 ./gradlew clean build on Java 17 produces build/libs/gs-spring-boot-0.1.0.jar passed
2 App boots with Spring Boot :: (v3.2.5) banner, Tomcat on :8080, Started Application logged passed
3 New H2 DDL (DROP TABLE IF EXISTS customers) + new varargs jdbcTemplate.query(sql, mapper, "Josh") both execute at startup and return exactly 2 rows (Josh Bloch, Josh Long) passed
4 GET /{"id":1,"content":"Hello, World!"} passed
5 GET /datetime → 200, body starts with Greetings from Spring Boot! and includes all expected fields passed
6 GET /topic → 200, 3-element JSON array with spring, java, javascript passed
7 GET /topic/string/operation → 200, includes Joining All String ID's with JOIN method: spring:java:javascript passed
8 GET /topic/file/operation → 200, includes temp.txt filter result Hello, this, is, Rehman passed
9 SIGINT shutdown is clean (HikariPool-1 - Shutdown completed.) passed
Boot log highlights (click to expand)
 :: Spring Boot ::                (v3.2.5)
2026-05-11T21:25:51.396Z  INFO 8757 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path ''
2026-05-11T21:25:51.414Z  INFO 8757 --- [main] hello.Application                        : Started Application in 2.52 seconds (process running for 3.091)
2026-05-11T21:25:51.503Z  WARN 8757 --- [main] hello.Application                        : Skipping demo quote fetch: I/O error on GET request for "http://gturnquist-quoters.cfapps.io/api/random": gturnquist-quoters.cfapps.io
2026-05-11T21:25:51.505Z  INFO 8757 --- [main] hello.Application                        : Creating tables
2026-05-11T21:25:51.710Z  INFO 8757 --- [main] hello.Application                        : Inserting customer record for John Woo
2026-05-11T21:25:51.711Z  INFO 8757 --- [main] hello.Application                        : Inserting customer record for Jeff Dean
2026-05-11T21:25:51.711Z  INFO 8757 --- [main] hello.Application                        : Inserting customer record for Josh Bloch
2026-05-11T21:25:51.711Z  INFO 8757 --- [main] hello.Application                        : Inserting customer record for Josh Long
2026-05-11T21:25:51.734Z  INFO 8757 --- [main] hello.Application                        : Querying for customer records where first_name = 'Josh':
2026-05-11T21:25:51.751Z  INFO 8757 --- [main] hello.Application                        : Customer{id=3, firstName='Josh', lastName='Bloch'}
2026-05-11T21:25:51.751Z  INFO 8757 --- [main] hello.Application                        : Customer{id=4, firstName='Josh', lastName='Long'}

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 DROP TABLE IF EXISTS syntax ran without throwing, and the new varargs JdbcTemplate.query overload returned both Josh rows.

Endpoint responses (click to expand)
$ curl -s -i http://localhost:8080/
HTTP/1.1 200
Content-Type: application/json

{"id":1,"content":"Hello, World!"}

$ curl -s -i 'http://localhost:8080/?name=Devin'
HTTP/1.1 200
Content-Type: application/json

{"id":2,"content":"Hello, Devin!"}

$ curl -s -i http://localhost:8080/datetime
HTTP/1.1 200
Content-Type: text/plain;charset=UTF-8

Greetings from Spring Boot! ----------------------Datetime now is 2026-05-11T21:26:20.133048590----------------------Datetime tomorrow will be 2026-05-12T21:26:20.133048590----------------------Datetime of previous month was 2026-04-11T21:26:20.133048590----------------------Is this a leap year ?  false----------------------Default system zone id   Etc/UTC-------------------Time in California: 2026-05-11T21:26:20.133048590-05:00[Canada/Central]

$ curl -s -i http://localhost:8080/topic
HTTP/1.1 200
Content-Type: application/json

[{"id":"spring","subjectName":"Spring Framework","subjectDescription":"Spring Framework Description"},{"id":"java","subjectName":"Core Java","subjectDescription":"Java Description"},{"id":"javascript","subjectName":"javascript Framework","subjectDescription":"javascript Framework Description"}]

$ curl -s -i http://localhost:8080/topic/string/operation
HTTP/1.1 200
Content-Type: text/plain;charset=UTF-8

Joining All String ID's with JOIN method: spring:java:javascript-------------Get all ID characters, select distict and sort with ID=   :acgijnprstv-------------Split All Id With Colon,Select ID With "Java" Keyword, Then Sort Then Join java:javascript-------------Return All ID having character 'g' in it:  [spring]

$ curl -s -i http://localhost:8080/topic/file/operation
HTTP/1.1 200
Content-Type: text/plain;charset=UTF-8

---------Find all files in path and sort:    README.md; application.properties; build; build.gradle; gradle; gradlew; gradlew.bat; gs-spring-boot.iml; mvnw; mvnw.cmd; pom.xml; src; target; temp.txt; test-plan.md----------Find File in present directory which strats with "grad",provided maximum depth=25 and sort : gradle; gradle/wrapper; gradle/wrapper/gradle-wrapper.jar; gradle/wrapper/gradle-wrapper.properties; gradlew; gradlew.bat----------Find File in present directory which strats with "grad",provided maximum depth=25 and sort :  with walk functiongradle; gradle/wrapper; gradle/wrapper/gradle-wrapper.jar; gradle/wrapper/gradle-wrapper.properties; gradlew; gradlew.bat---------Read "temp.txt" file with stream functions, having "print" witin it:   Hello, this, is, Rehman

Tested by: Devin session

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

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