Skip to content

Migrate to Java 17 and Spring Boot 3.2.5#18

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1777904735-java17-springboot3-migration
Open

Migrate to Java 17 and Spring Boot 3.2.5#18
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1777904735-java17-springboot3-migration

Conversation

@devin-ai-integration
Copy link
Copy Markdown

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

Summary

Migrates springboot-java8 from Java 8 / Spring Boot 2.0.2 to Java 17 / Spring Boot 3.2.5 across both the Maven and Gradle build files.

pom.xml

  • spring-boot-starter-parent 2.0.2.RELEASE → 3.2.5
  • <java.version> 1.8 → 17
  • <packaging> pom → jar (the original was set to pom, which prevents Maven from compiling Java sources — flagged as a known bug in the repo's environment notes; needed to actually verify the migration compiles)
  • Drop spring-boot-properties-migrator — it was historically used to flag deprecated 1.x property names in 2.x; nothing in application.properties or this codebase relies on it, so it's not useful for 2.x → 3.x and Spring Boot stops shipping it after 3.x for that path
  • Pin maven-compiler-plugin 3.11.0 with <source>17</source>/<target>17</target>
  • Add spring-boot-starter-test (provides JUnit 5) so the test lifecycle is wired up even though the project currently has no tests under src/test/

build.gradle

  • spring-boot-gradle-plugin 2.0.2.RELEASE → 3.2.5
  • sourceCompatibility / targetCompatibility 1.8 → 17
  • compile(...)implementation(...), testCompile(...)testImplementation(...)
  • Replace junit:junit with spring-boot-starter-test (JUnit 5; matches Spring Boot 3 conventions)
  • Add spring-boot-starter-jdbc and h2 — these were declared in pom.xml but were missing from build.gradle, so gradlew build could not compile Application.java even on the original codebase
  • bootJar { baseName = ...; version = ... }archiveBaseName / archiveVersion — the legacy properties were removed in modern Gradle / the Boot 3 plugin

Build wrappers (Boot 3.2 enforces minimum versions)

  • Maven wrapper: 3.3.9 → 3.9.6 (Boot 3.2 requires Maven 3.6.3+)
  • Gradle wrapper: 4.6 → 8.5 (Boot 3.2 requires Gradle 7.5+)

gs-spring-boot.iml

  • LANGUAGE_LEVEL JDK_1_8JDK_17. The library entries that reference javax.annotation:javax.annotation-api:1.3.2 and javax.validation:validation-api:2.0.1.Final are auto-generated by IntelliJ and will be regenerated to their jakarta.* equivalents on the next "Reimport All Maven Projects" action; updating them by hand would just be churn that IntelliJ rewrites.

javax.*jakarta.* source migration

  • No source changes were needed: a full grep over src/ finds zero javax.* imports in the application code. The only javax.* references in the repo are in IntelliJ metadata (.idea/uiDesigner.xml references javax.swing.*, which is part of the JDK and not affected by Jakarta EE 9; gs-spring-boot.iml library entries are regenerated by IntelliJ).

Other dependency updates

  • JUnit 4 dropped in favor of JUnit 5 via spring-boot-starter-test, in line with the migration guidance.
  • All other transitive dependencies (Tomcat, Jackson, Hibernate Validator, etc.) come from the Spring Boot 3.2.5 BOM and are inherited automatically.

Verification

Locally on JDK 17:

  • ./mvnw clean packageBUILD SUCCESS. Produces a runnable target/gs-spring-boot-0.1.0.jar that starts on Spring Boot 3.2.5 + Tomcat 10 + H2 (verified by running the jar — Tomcat starts on :8080, the JdbcTemplate seed/query for customers runs cleanly).
  • ./gradlew buildBUILD SUCCESSFUL.

Note: the existing Application CommandLineRunner calls http://gturnquist-quoters.cfapps.io/api/random, which is a long-decommissioned demo endpoint and has been broken on master independent of this migration. It surfaces as a runtime DNS error after the Spring context starts; it is not caused by the upgrade and is out of scope here.

Review & Testing Checklist for Human

  • Confirm dropping spring-boot-properties-migrator is acceptable for your usage; if you want to keep it temporarily, it should be removed once the upgrade is validated.
  • Confirm flipping <packaging> from pom to jar is acceptable (it's required for the project to compile / produce an executable jar).
  • Verify any downstream IntelliJ users do an "Reimport All Maven Projects" after pulling so gs-spring-boot.iml regenerates the jakarta.* library entries.
  • Decide whether the dead gturnquist-quoters.cfapps.io quote-of-the-day call in Application.java should be removed/replaced as a follow-up; it's pre-existing but more visible now that the rest of the stack is healthy.
  • Run ./mvnw spring-boot:run (or java -jar target/gs-spring-boot-0.1.0.jar) on JDK 17 and exercise an endpoint, e.g. curl http://localhost:8080/greeting?name=world, curl http://localhost:8080/topics.

Notes

  • Pre-existing tracked target/classes/*.class files were left untouched to keep the diff scoped to the migration; they will be overwritten on the next build. A follow-up to add target/ and build/ to .gitignore would be a small, separate clean-up.

Link to Devin session: https://app.devin.ai/sessions/5c0474b7621b477d8683100447bfadf0
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: bump spring-boot-starter-parent 2.0.2.RELEASE -> 3.2.5,
  java.version 1.8 -> 17, packaging pom -> jar (so the project actually
  compiles), drop spring-boot-properties-migrator (only relevant for
  1.x->2.x property changes), pin maven-compiler-plugin 3.11.0 with
  source/target=17, and add spring-boot-starter-test for JUnit 5.

- build.gradle: bump spring-boot-gradle-plugin 2.0.2.RELEASE -> 3.2.5,
  source/target compatibility 1.8 -> 17, switch compile/testCompile to
  implementation/testImplementation, replace JUnit 4 with
  spring-boot-starter-test (JUnit 5), add starter-jdbc + h2 (already in
  pom.xml; gradle build was missing them and could not compile), and
  switch bootJar to archiveBaseName/archiveVersion (the legacy
  baseName/version properties were removed in newer Gradle).

- Maven wrapper: 3.3.9 -> 3.9.6 (Spring Boot 3.2 needs Maven 3.6.3+).
- Gradle wrapper: 4.6 -> 8.5 (Spring Boot 3.2 needs Gradle 7.5+).
- gs-spring-boot.iml: bump LANGUAGE_LEVEL JDK_1_8 -> JDK_17.

No javax.* -> jakarta.* changes were required: src/ contains no
javax.* imports. Verified mvn package and gradle build both succeed
with JDK 17, and the boot jar starts cleanly on Spring Boot 3.2.5
(Tomcat 10 / H2).
@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