Upgrade to Java 17 and Spring Boot 3.2.5#25
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
- 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).
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
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.xml2.0.2.RELEASE→3.2.5.java.version:1.8→17.spring-boot-properties-migrator(a 1.x → 2.x migration aid; not needed for 3.x).spring-boot-starter-web,spring-boot-starter-jdbc, andh2as-is — they resolve to Spring Boot 3.2.x compatible versions through the parent BOM.<packaging>frompomtojarso Java sources are actually compiled and a runnable Spring Boot jar is produced. Withpompackaging,mvn compile/mvn packageskips Java compilation, so this was already broken onmaster.build.gradlespring-boot-gradle-plugin:2.0.2.RELEASE→3.2.5.sourceCompatibility/targetCompatibility:1.8→17.bootJarblock:baseName→archiveBaseName,version→archiveVersion(the old DSL was removed in Gradle 7+).compile→implementation,testCompile→testImplementation.src/main/java/hello/Application.javaDROP TABLE customers IF EXISTS→DROP TABLE IF EXISTS customers. The legacy form was removed in H2 2.x (which is what Spring Boot 3.x bundles).JdbcTemplate.query(sql, Object[] args, RowMapper)overload toJdbcTemplate.query(sql, RowMapper, varargs...)— note the argument-order swap (RowMappernow comes before the parameter values).gs-spring-boot.imlLANGUAGE_LEVEL:JDK_1_8→JDK_17. (IDE-generated; updated for consistency.)Maven wrapper
mvn wrapper:wrapper(Maven3.9.6,only-scriptdistribution). 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.jaris removed because the newonly-scriptwrapper doesn't need it.Not touched
No source-level
javax.*→jakarta.*rename was needed — the codebase doesn't import anyjavax.*packages directly. Transitivejavax.annotation-api/javax.validation-apiare auto-replaced by Jakarta equivalents through Spring Boot 3.2.x dependency management.Review & Testing Checklist for Human
<packaging>pom</packaging>→jarchange. This is required formvn compile/mvn packageto actually compile sources and was outside the original migration plan, but the repo cannot build a runnable jar without it.3.9.6,only-scriptdistribution;.mvn/wrapper/maven-wrapper.jarremoved) matches your team's wrapper conventions, or if you'd prefer a different Maven version / wrapper type../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 fromApplication.maintohttp://gturnquist-quoters.cfapps.io/api/randomthat throwsUnknownHostExceptionon networks that can't resolve that host — this is unrelated to the upgrade and existed onmaster.4.6, which cannot run on Java 17. You'll need to upgrade the Gradle wrapper (e.g., to8.x) before./gradlew clean buildwill succeed. Out of scope for this PR per the migration plan.Test plan I ran on the box
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 ./mvnw -B clean compile→BUILD SUCCESS.JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 ./mvnw -B clean package -DskipTests→BUILD SUCCESS, producestarget/gs-spring-boot-0.1.0.jar.java -jar target/gs-spring-boot-0.1.0.jar --server.port=8181→Tomcat started on port 8181,Started Application in 2.359 seconds. The app then crashes from the pre-existing externalRestTemplatecall described above; this is not a regression.Notes
.classfiles undertarget/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 addingtarget/to.gitignorein a follow-up.Link to Devin session: https://app.devin.ai/sessions/e344dd76e80c4292a4e88d3a709e0e6b
Requested by: @vanessasalas-cog
Devin Review