Skip to content

Upgrade to Java 17 and Spring Boot 3.2.5#25

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

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

Conversation

@devin-ai-integration
Copy link
Copy Markdown

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

Summary

Upgrades this project from Java 8 / Spring Boot 2.0.2.RELEASE to Java 17 / Spring Boot 3.2.5, following the migration plan in the linked Devin session.

pom.xml

  • Spring Boot parent: 2.0.2.RELEASE3.2.5.
  • java.version: 1.817.
  • Removed spring-boot-properties-migrator (a 1.x → 2.x migration aid; not needed for 3.x).
  • Kept spring-boot-starter-web, spring-boot-starter-jdbc, and h2 as-is — they resolve to Spring Boot 3.2.x compatible versions through the parent BOM.
  • Changed <packaging> from pom to jar so Java sources are actually compiled and a runnable Spring Boot jar is produced. With pom packaging, mvn compile/mvn package skips Java compilation, so this was already broken on master.

build.gradle

  • spring-boot-gradle-plugin: 2.0.2.RELEASE3.2.5.
  • sourceCompatibility / targetCompatibility: 1.817.
  • bootJar block: baseNamearchiveBaseName, versionarchiveVersion (the old DSL was removed in Gradle 7+).
  • Replaced deprecated configurations: compileimplementation, testCompiletestImplementation.

src/main/java/hello/Application.java

  • H2 2.x SQL syntax fix: DROP TABLE customers IF EXISTSDROP TABLE IF EXISTS customers. The legacy form was removed in H2 2.x (which is what Spring Boot 3.x bundles).
  • Migrated off the deprecated JdbcTemplate.query(sql, Object[] args, RowMapper) overload to JdbcTemplate.query(sql, RowMapper, varargs...) — note the argument-order swap (RowMapper now comes before the parameter values).

gs-spring-boot.iml

  • LANGUAGE_LEVEL: JDK_1_8JDK_17. (IDE-generated; updated for consistency.)

Maven wrapper

  • Regenerated via mvn wrapper:wrapper (Maven 3.9.6, only-script distribution). Spring Boot 3.2.5 requires Maven 3.6.3+, which the previous wrapper (3.3.9) doesn't satisfy. The legacy .mvn/wrapper/maven-wrapper.jar is removed because the new only-script wrapper doesn't need it.

Not touched

No source-level javax.*jakarta.* rename was needed — the codebase doesn't import any javax.* packages directly. Transitive javax.annotation-api / javax.validation-api are auto-replaced by Jakarta equivalents through Spring Boot 3.2.x dependency management.

Review & Testing Checklist for Human

  • Confirm you're OK with the <packaging>pom</packaging>jar change. This is required for mvn compile/mvn package to actually compile sources and was outside the original migration plan, but the repo cannot build a runnable jar without it.
  • Decide whether the regenerated Maven wrapper (Maven 3.9.6, only-script distribution; .mvn/wrapper/maven-wrapper.jar removed) matches your team's wrapper conventions, or if you'd prefer a different Maven version / wrapper type.
  • Run the app locally with Java 17 (./mvnw spring-boot:run) and hit the documented endpoints: GET /, /datetime, /topic, /topic/string/operation, /topic/file/operation, /topic/sort. The app does have a pre-existing call from Application.main to http://gturnquist-quoters.cfapps.io/api/random that throws UnknownHostException on networks that can't resolve that host — this is unrelated to the upgrade and existed on master.
  • If you also build with Gradle: the Gradle wrapper in this repo is still pinned to Gradle 4.6, which cannot run on Java 17. You'll need to upgrade the Gradle wrapper (e.g., to 8.x) before ./gradlew clean build will succeed. Out of scope for this PR per the migration plan.
  • Verify CI passes.

Test plan I ran on the box

  • JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 ./mvnw -B clean compileBUILD SUCCESS.
  • JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 ./mvnw -B clean package -DskipTestsBUILD SUCCESS, produces target/gs-spring-boot-0.1.0.jar.
  • java -jar target/gs-spring-boot-0.1.0.jar --server.port=8181Tomcat started on port 8181, Started Application in 2.359 seconds. The app then crashes from the pre-existing external RestTemplate call described above; this is not a regression.

Notes

  • The repo has compiled .class files under target/classes/ checked into git (which is unusual for a Java project). I did not include the recompiled bytecode in this PR — those artifacts will be regenerated on the first Java 17 build and should not churn alongside source-level changes. Consider adding target/ to .gitignore in a follow-up.

Link to Devin session: https://app.devin.ai/sessions/e344dd76e80c4292a4e88d3a709e0e6b
Requested by: @vanessasalas-cog


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

- pom.xml: Spring Boot parent 2.0.2.RELEASE -> 3.2.5; java.version 1.8 -> 17;
  remove spring-boot-properties-migrator (legacy 1.x->2.x migration aid);
  set packaging from pom -> jar so Java sources actually compile.
- build.gradle: spring-boot-gradle-plugin 2.0.2.RELEASE -> 3.2.5;
  sourceCompatibility/targetCompatibility 1.8 -> 17; bootJar baseName/version
  -> archiveBaseName/archiveVersion (Gradle 7+ API); compile/testCompile ->
  implementation/testImplementation.
- src/main/java/hello/Application.java: H2 2.x SQL syntax fix
  (DROP TABLE customers IF EXISTS -> DROP TABLE IF EXISTS customers); switch
  to non-deprecated JdbcTemplate.query overload (RowMapper before varargs).
- gs-spring-boot.iml: LANGUAGE_LEVEL JDK_1_8 -> JDK_17.
- Maven wrapper: regenerated for Java 17 / Spring Boot 3.2.5 (Maven 3.9.6,
  only-script distribution; legacy wrapper jar removed).
@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

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.

1 participant