Skip to content

Migrate from Java 8 / Spring Boot 2.0.2 to Java 21 / Spring Boot 3.3.5#16

Open
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/1777349463-java21-spring-boot-3-migration
Open

Migrate from Java 8 / Spring Boot 2.0.2 to Java 21 / Spring Boot 3.3.5#16
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/1777349463-java21-spring-boot-3-migration

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 28, 2026

Summary

Migrates the project from Java 8 + Spring Boot 2.0.2.RELEASE to Java 21 + Spring Boot 3.3.5, updating all build tooling and fixing breaking changes.

Changes

pom.xml

  • Spring Boot parent version: 2.0.2.RELEASE3.3.5
  • Java version: 1.821
  • Removed spring-boot-properties-migrator dependency (only needed for 1.x→2.x migration)
  • Fixed packaging: pomjar (was preventing Maven from compiling sources)

build.gradle

  • Spring Boot Gradle plugin: 2.0.2.RELEASE3.3.5
  • sourceCompatibility / targetCompatibility: 1.821
  • compileimplementation, testCompiletestImplementation
  • baseName / versionarchiveBaseName / archiveVersion
  • Added missing spring-boot-starter-jdbc and h2 dependencies (to match pom.xml)

src/main/java/hello/Application.java

  • Fixed H2 SQL syntax: DROP TABLE customers IF EXISTSDROP TABLE IF EXISTS customers (H2 2.x requires standard SQL)
  • Fixed deprecated JdbcTemplate.query(): swapped new Object[]{"Josh"} to varargs overload (RowMapper before args)
  • Removed defunct gturnquist-quoters.cfapps.io REST calls (service is offline, caused ResourceAccessException crash on startup in Spring Boot 3.x)

.mvn/wrapper/maven-wrapper.properties

  • Maven: 3.3.93.9.9

gradle/wrapper/gradle-wrapper.properties

  • Gradle: 4.68.10.2

Files intentionally unchanged

All model/controller/service/declaration files use Java 8 features (streams, lambdas, java.time, NIO, functional interfaces) that are fully forward-compatible with Java 21.

Review & Testing Checklist for Human

  • Verify the Maven build compiles and packages: ./mvnw clean package
  • Verify the Gradle build compiles: ./gradlew clean build
  • Run ./gradlew bootRun and test endpoints at localhost:8080 (GET /, GET /topic, GET /datetime)

Notes

  • JDK 21 must be installed to build/run
  • Three pre-existing build issues were fixed: Maven <packaging>pom</packaging> prevented compilation, build.gradle was missing JDBC/H2 dependencies, and defunct REST calls crashed the app on startup
  • All endpoints tested and working: GET / returns greeting JSON, GET /topic returns topic list, GET /datetime returns datetime info, GET /topic/sort returns sorted topics

Link to Devin session: https://app.devin.ai/sessions/1a864a864ae94267a807f2c2b35cc84d
Requested by: @clivingston-cognition

- Update pom.xml: Java 21, Spring Boot 3.3.5, remove spring-boot-properties-migrator
- Update build.gradle: plugin 3.3.5, Java 21, implementation/testImplementation, archiveBaseName
- Fix H2 SQL syntax: DROP TABLE IF EXISTS (standard SQL for H2 2.x)
- Fix deprecated JdbcTemplate.query(): use varargs overload instead of Object[]
- Update Maven wrapper to 3.9.9
- Update Gradle wrapper to 8.10.2

Co-Authored-By: Chris Livingston <chris.livingston@cognition.ai>
@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

@staging-devin-ai-integration
Copy link
Copy Markdown

Devin Review

Status Commit
⚪ Not started

Open in Devin Review (Staging)

💡 Connect your GitHub account to enable automatic code reviews.

devin-ai-integration Bot and others added 2 commits April 28, 2026 04:20
…cies

- pom.xml: change packaging from 'pom' to 'jar' so Maven compiles sources
- build.gradle: add spring-boot-starter-jdbc and h2 dependencies to match pom.xml

Co-Authored-By: Chris Livingston <chris.livingston@cognition.ai>
The external quoter service is no longer available and causes
ResourceAccessException on startup, crashing the app in Spring Boot 3.x.

Co-Authored-By: Chris Livingston <chris.livingston@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
Author

End-to-End Test Results

All 4 tests passed. App runs on JDK 21 + Spring Boot 3.3.5, H2 operations work, all REST endpoints respond correctly.

Test 1: App startup with H2 + JDBC operations (proves migration fixes)
Assertion Result
Startup log shows Java 21.0.10 PASSED
Startup log shows Spring Boot :: (v3.3.5) PASSED
Tomcat started on port 8080 PASSED
Creating tables logged (CommandLineRunner entered) PASSED
Inserting customer record for Josh Bloch + Josh Long (H2 SQL fix works) PASSED
Customer{id=3, firstName='Josh', lastName='Bloch'} returned (JdbcTemplate varargs fix works) PASSED
No JdbcSQLSyntaxErrorException or IllegalArgumentException PASSED

Key log excerpt:

hello.Application : Creating tables
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'}
Test 2: REST endpoints (Spring Boot 3.x runtime)
Endpoint Expected Actual Result
GET / JSON with "Hello, World!" {"id":1,"content":"Hello, World!"} PASSED
GET /topic JSON array with topics 3 topics with id, subjectName, subjectDescription PASSED
GET /datetime String with datetime Greetings from Spring Boot! ...2026-04-28T04:23:55... PASSED
GET /topic/sort Sorted JSON array Sorted by id: java < javascript < spring PASSED
Test 3 & 4: Build systems
Build Command Result
Gradle 8.10.2 ./gradlew clean build BUILD SUCCESSFUL in 2s
Maven 3.9.9 ./mvnw clean package BUILD SUCCESS, produced gs-spring-boot-0.1.0.jar

Devin session

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