Java 21 migration — Maven build config#20
Conversation
- Bump Spring Boot parent from 2.0.2.RELEASE to 3.2.5 - Bump java.version from 1.8 to 21 - Remove spring-boot-properties-migrator (only needed for 1.x→2.x) - Bump Maven wrapper distribution from 3.3.9 to 3.9.6 (required for Java 21) Co-Authored-By: Phil Bedford <phil.bedford@cognition.ai>
🤖 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:
|
382eabc
into
devin/1777913688-java21-migration-base
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-parent</artifactId> | ||
| <version>2.0.2.RELEASE</version> | ||
| <version>3.2.5</version> |
There was a problem hiding this comment.
🔴 H2 2.x incompatible SQL syntax: DROP TABLE customers IF EXISTS
Upgrading Spring Boot to 3.2.5 pulls in H2 2.x, which no longer supports the legacy DROP TABLE tablename IF EXISTS syntax. The code at src/main/java/hello/Application.java:66 uses DROP TABLE customers IF EXISTS, which will throw a SQL parse error at runtime. H2 2.x requires the standard SQL syntax DROP TABLE IF EXISTS customers. Since this runs in a CommandLineRunner, it will crash the application on startup.
Prompt for agents
The Spring Boot upgrade from 2.0.2.RELEASE to 3.2.5 brings in H2 2.x, which has multiple SQL syntax breaking changes affecting src/main/java/hello/Application.java.
1. Line 66: DROP TABLE customers IF EXISTS must be changed to DROP TABLE IF EXISTS customers (H2 2.x dropped the legacy syntax).
2. Line 67: id SERIAL is no longer supported in H2 2.x default mode. It should be changed to id BIGINT GENERATED BY DEFAULT AS IDENTITY (or INT AUTO_INCREMENT, etc.).
Both of these execute inside the CommandLineRunner.run() method, so the app will fail to start. Fix both SQL statements in Application.java to use H2 2.x compatible syntax.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Confirmed real — src/main/java/hello/Application.java:66 does have DROP TABLE customers IF EXISTS, which will break under H2 2.x.
However, this PR is scoped to Maven build config only per the parent migration spec. .java source files are owned by a sibling child session that handles Java 8 → Java 21 source updates. This particular fix needs to land in that sibling PR (or in the integration PR), not this one. Flagging to the parent session so the sibling owner can pick it up.
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-parent</artifactId> | ||
| <version>2.0.2.RELEASE</version> | ||
| <version>3.2.5</version> |
There was a problem hiding this comment.
🔴 H2 2.x incompatible SQL syntax: SERIAL type removed in default mode
The upgrade to Spring Boot 3.2.5 brings in H2 2.x, which removed the SERIAL pseudo-type in its default SQL compatibility mode. The code at src/main/java/hello/Application.java:67 uses CREATE TABLE customers(id SERIAL, ...), which will fail with an unknown data type error. It should be replaced with id BIGINT GENERATED BY DEFAULT AS IDENTITY or id INT AUTO_INCREMENT. This runs in a CommandLineRunner so it will crash the application on startup.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Confirmed real — src/main/java/hello/Application.java:67 uses id SERIAL, which is no longer valid in H2 2.x default mode. Recommended fix is id BIGINT GENERATED BY DEFAULT AS IDENTITY (or id INT AUTO_INCREMENT).
Same scope note as the sibling comment: this PR is Maven build config only; .java source changes belong to the sibling child session. Flagging to the parent session for routing.
Summary
Maven build configuration changes for the Java 8 → Java 21 / Spring Boot 2.0.2 → Spring Boot 3.2.5 migration. Scoped to Maven config only — no Gradle, source, or other files touched (those are handled by sibling PRs).
Changes in
pom.xml:2.0.2.RELEASE→3.2.5<java.version>:1.8→21spring-boot-properties-migratordependency (it was added for the 1.x → 2.x migration and is no longer needed; it is also no longer published for Spring Boot 3.x)spring-boot-starter-web,spring-boot-starter-jdbc,h2) left untouched — they pick up compatible versions from the new parent BOMChanges in
.mvn/wrapper/maven-wrapper.properties:distributionUrl:apache-maven-3.3.9→apache-maven-3.9.6(Maven 3.9+ is required for Java 21)Review & Testing Checklist for Human
3.2.5is the intended target version for the migration3.9.6matches whatever the integration PR / sibling PRs assume./mvnw clean packageruns there once Java source changes (sibling PR) are also merged inNotes
devin/1777913688-java21-migration-base(NOTmaster) so it can be combined with sibling PRs (Gradle config, Java source) on the integration branch.build.gradle,gradle/wrapper/gradle-wrapper.properties, and all.javasource files were intentionally left untouched (owned by sibling PRs).Link to Devin session: https://app.devin.ai/sessions/ce68c976af9d48f1af76fae1be84dd26
Requested by: @dr-phil
Devin Review