Migrate to Java 17 and Spring Boot 3.2.5#18
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
- 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).
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates
springboot-java8from Java 8 / Spring Boot 2.0.2 to Java 17 / Spring Boot 3.2.5 across both the Maven and Gradle build files.pom.xmlspring-boot-starter-parent2.0.2.RELEASE → 3.2.5<java.version>1.8 → 17<packaging>pom → jar (the original was set topom, 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)spring-boot-properties-migrator— it was historically used to flag deprecated 1.x property names in 2.x; nothing inapplication.propertiesor 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 pathmaven-compiler-plugin3.11.0 with<source>17</source>/<target>17</target>spring-boot-starter-test(provides JUnit 5) so thetestlifecycle is wired up even though the project currently has no tests undersrc/test/build.gradlespring-boot-gradle-plugin2.0.2.RELEASE → 3.2.5sourceCompatibility/targetCompatibility1.8 → 17compile(...)→implementation(...),testCompile(...)→testImplementation(...)junit:junitwithspring-boot-starter-test(JUnit 5; matches Spring Boot 3 conventions)spring-boot-starter-jdbcandh2— these were declared inpom.xmlbut were missing frombuild.gradle, sogradlew buildcould not compileApplication.javaeven on the original codebasebootJar { baseName = ...; version = ... }→archiveBaseName/archiveVersion— the legacy properties were removed in modern Gradle / the Boot 3 pluginBuild wrappers (Boot 3.2 enforces minimum versions)
gs-spring-boot.imlLANGUAGE_LEVELJDK_1_8→JDK_17. The library entries that referencejavax.annotation:javax.annotation-api:1.3.2andjavax.validation:validation-api:2.0.1.Finalare auto-generated by IntelliJ and will be regenerated to theirjakarta.*equivalents on the next "Reimport All Maven Projects" action; updating them by hand would just be churn that IntelliJ rewrites.javax.*→jakarta.*source migrationsrc/finds zerojavax.*imports in the application code. The onlyjavax.*references in the repo are in IntelliJ metadata (.idea/uiDesigner.xmlreferencesjavax.swing.*, which is part of the JDK and not affected by Jakarta EE 9;gs-spring-boot.imllibrary entries are regenerated by IntelliJ).Other dependency updates
spring-boot-starter-test, in line with the migration guidance.Verification
Locally on JDK 17:
./mvnw clean package—BUILD SUCCESS. Produces a runnabletarget/gs-spring-boot-0.1.0.jarthat starts on Spring Boot 3.2.5 + Tomcat 10 + H2 (verified by running the jar — Tomcat starts on:8080, the JdbcTemplate seed/query forcustomersruns cleanly)../gradlew build—BUILD SUCCESSFUL.Note: the existing
ApplicationCommandLineRunnercallshttp://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
spring-boot-properties-migratoris acceptable for your usage; if you want to keep it temporarily, it should be removed once the upgrade is validated.<packaging>frompomtojaris acceptable (it's required for the project to compile / produce an executable jar).gs-spring-boot.imlregenerates thejakarta.*library entries.gturnquist-quoters.cfapps.ioquote-of-the-day call inApplication.javashould be removed/replaced as a follow-up; it's pre-existing but more visible now that the rest of the stack is healthy../mvnw spring-boot:run(orjava -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
target/classes/*.classfiles were left untouched to keep the diff scoped to the migration; they will be overwritten on the next build. A follow-up to addtarget/andbuild/to.gitignorewould be a small, separate clean-up.Link to Devin session: https://app.devin.ai/sessions/5c0474b7621b477d8683100447bfadf0
Requested by: @vanessasalas-cog
Devin Review