Repository navigation
Migrate from Java 8 to Java 11 (LTS) - #32
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
🤖 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:
|
72d33af to
58a8b78
Compare
Testing Results: Java 8 → Java 11 MigrationMethod: Started app with EscalationsNone — all tests passed. Test Results (9/9 passed)
Startup EvidenceEndpoint Evidence |
aa40f9a to
95cd0a8
Compare
ac2a9b5 to
d39fb3f
Compare
|
Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it. |
1a3a8ca to
4e10833
Compare
| - name: Build and test (Maven) | ||
| run: ./mvnw -B clean verify |
There was a problem hiding this comment.
🚩 CI only verifies packaging, not that the migrated application starts
The new workflow runs ./mvnw -B clean verify, but there are no tests and the Maven lifecycle stops after packaging; it does not execute the generated Boot jar or load the Spring application context. Given Application.main and both CommandLineRunner paths perform startup work including external HTTP calls and JDBC initialization (src/main/java/hello/Application.java:38-55 and src/main/java/hello/Application.java:62-87), CI can be green while runtime startup is still broken. This is worth following up with a smoke test or a startup mode that disables external network calls during CI.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip |
There was a problem hiding this comment.
🚩 Wrapper JARs not updated alongside distribution version bumps
Both gradle-wrapper.jar and maven-wrapper.jar remain unchanged from the original project (Gradle 4.6 era / Maven 3.3.9 era), while the distribution URLs were bumped to Gradle 6.9.4 and Maven 3.9.9. The old wrapper JARs should still function—their primary job is downloading the specified distribution—but they lack newer features and bug fixes. The wrapperUrl property added in .mvn/wrapper/maven-wrapper.properties:3 pointing to maven-wrapper-3.3.2.jar will be ignored by the old wrapper JAR since it predates that feature. Best practice is to regenerate wrapper JARs when upgrading (e.g., gradle wrapper --gradle-version 6.9.4 and mvn wrapper:wrapper -Dmaven=3.9.9).
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
…gins - maven-compiler-plugin 3.11.0 with <release>11</release>, -Xlint:all -Werror - surefire/failsafe 3.2.5, javadoc 3.6.3, enforcer 3.5.0 requireJavaVersion [11,) - packaging pom -> jar so sources compile and repackage on JDK 11 - upgrade Maven wrapper 3.3.9 -> 3.9.9 Co-Authored-By: derek.wu <derekwu35@gmail.com>
Co-Authored-By: derek.wu <derekwu35@gmail.com>
…Gradle cache Co-Authored-By: derek.wu <derekwu35@gmail.com>
Co-Authored-By: derek.wu <derekwu35@gmail.com>
Co-Authored-By: derek.wu <derekwu35@gmail.com>
126e53e to
e8215b7
Compare
There was a problem hiding this comment.
🚩 Spring Boot 2.0.2 predates official Java 11 support
The PR acknowledges this in MIGRATION_NOTES.md:104-106, but it's worth noting as a reviewer: Spring Boot 2.0.x was EOL before Java 11 GA. While the build compiles cleanly on JDK 11, runtime behavior (especially Spring Framework 5.0's reflection and proxy internals) may exhibit subtle issues on JDK 11+ that are fixed in Spring Boot 2.1+. The -Xlint:all -Werror flags and the enforcer plugin help catch compile-time issues, but they don't guard against runtime incompatibilities. The project currently has zero tests, so there's no runtime validation in CI.
(Refers to line 14)
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
There was a problem hiding this comment.
🚩 Spring Boot 2.0.2 predates official JDK 11 support
The PR migrates to Java 11 but retains Spring Boot 2.0.2.RELEASE (pom.xml:14, build.gradle:6). Spring Boot 2.0.x / Spring Framework 5.0.x did not officially support JDK 11 — that was added in Spring Boot 2.1.x. While the build compiles and packages cleanly (as noted in MIGRATION_NOTES.md), there may be subtle runtime issues (e.g., reflection warnings, internal API usage) that only manifest at runtime under JDK 11. The PR author correctly documents this as a follow-up item in MIGRATION_NOTES.md:101-104, but reviewers should be aware this is a known gap in the migration.
(Refers to line 14)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Acknowledged and intentional. This PR is scoped to the Java 8 → 11 toolchain/CI migration with minimal behavior change, so the framework version is deliberately held at Spring Boot 2.0.2. It compiles, packages, and boots on JDK 11 (the Spring context starts; the only startup failure is a pre-existing call to a now-dead external quotes endpoint, identical on Java 8). The Spring Boot 2.1+/2.7.x upgrade for officially-supported JDK 11 runtime is called out as a follow-up in MIGRATION_NOTES.md and the PR description.
There was a problem hiding this comment.
🚩 Gradle wrapper script lacks executable permission (pre-existing)
The gradlew script is tracked with git mode 100644 (not executable), while mvnw is correctly 100755. Running ./gradlew clean build on Linux/macOS would fail with a permission error unless chmod +x is applied first. This is a pre-existing issue (not introduced by this PR), but the PR does modify the Gradle wrapper properties and documents ./gradlew clean build as a valid build command in README.md:92, making it more likely someone will hit this.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Fixed in this branch — gradlew is now tracked with mode 100755 (executable), matching mvnw:
$ git ls-tree HEAD gradlew mvnw
100755 blob ... gradlew
100755 blob ... mvnw
The Gradle CI job (./gradlew --no-daemon clean build) runs the wrapper directly without a chmod step and passes, confirming the executable bit is set.
Summary
Minimal, behavior-preserving migration of
springboot-java8from Java 8 to Java 11 (LTS). The Maven and Gradle builds now target Java 11, a GitHub Actions CI builds both on Temurin JDK 11, and docs are added/updated. No application source changed — a source scan found no removed JDK modules (JAXB / JAX-WS / JavaFX / CORBA / Nashorn /sun.misc), so no replacement dependencies were needed.The key non-obvious change: the Maven build declared
<packaging>pom</packaging>, so it never compiled or tested thehello.*sources —mvn package"passed" while producing no classes. Switching tojaris what makes the Java 11--releaseactually apply and the migration verifiable.Build
Maven (
pom.xml) — canonical build:pom→jarpackaging so compile / test / repackage actually run.<java.version>1.8</java.version>; addedmaven.compiler.release=11and UTF-8 source/reporting encoding.maven-compiler-plugin3.11.0 with<release>11</release>and-Xlint:all -Werror(source is warning-clean).maven-surefire-plugin3.2.5,maven-failsafe-plugin3.2.5,maven-javadoc-plugin3.6.3 (doclint off),maven-enforcer-plugin3.5.0 withrequireJavaVersion [11,).spring-boot-starter-test(test scope).3.3.9→3.9.9(surefire/enforcer 3.x require Maven ≥ 3.6.3).Gradle (
build.gradle) — secondary build:4.6→6.9.4(4.6 cannot run on JDK 11).sourceCompatibility/targetCompatibility = 1.8with a Java toolchain pinned to 11 (Gradle rejects combining a project toolchain with source/target compatibility).compile/testCompile→implementation/testImplementation.spring-boot-starter-jdbc+h2— the Gradle build only declaredstarter-weband failed to compileApplication(JdbcTemplate) even on Java 8. These already exist inpom.xml.Removals / Replacements
None. No usages of removed JDK modules were found, so no JAXB/JAX-WS/JavaFX/Activation deps were added.
Encapsulation
Built on the classpath (no
module-info.java). No--add-opensneeded — the application produces no illegal-reflective-access warnings on JDK 11. (Gradle 6.9.4's own Groovy runtime prints such a warning during the build; that is Gradle itself, not project code.)Security / GC
No TLS config, keystores, certs, or custom GC/JVM flags exist in the repo, so Java 11 defaults (TLS 1.3, PKCS12, G1, unified logging) apply with no changes.
Validation
./mvnw -B -e clean verify(JDK 11) → BUILD SUCCESS; enforcerRequireJavaVersion passed;Compiling 13 source files with javac [debug release 11]; surefireNo tests to run;spring-boot:repackagesucceeded../gradlew --no-daemon clean build(JDK 11) → BUILD SUCCESSFUL.CommandLineRunnerthen calls an external quotes endpoint (gturnquist-quoters.cfapps.io) that is no longer reachable and exits — pre-existing, network-related, identical on Java 8, unrelated to the migration..github/workflows/ci.yml—actions/setup-java@v4(Temurin 11) with two jobs: Maven (./mvnw -B -e clean verify, cache: maven) and Gradle (./gradlew --no-daemon clean build, cache: gradle).target/classes; ignoretarget/,build/,.gradle/.Follow-ups (out of scope)
@SpringBootTestsmoke test) so CI verifies runtime behavior.See
MIGRATION_NOTES.mdfor full details.Link to Devin session: https://app.devin.ai/sessions/ddd71375f7aa4b8fbbedff65360ba605
Requested by: @TheWuster935
Devin Review
e8215b7