|
| 1 | +# Migration Notes: Java 9 to Java 11 |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This document describes the changes made to migrate the Java8InAction codebase from Java 9 (source/target 1.9) to Java 11. |
| 6 | + |
| 7 | +## Build Tool Changes (`pom.xml`) |
| 8 | + |
| 9 | +### Compiler Configuration |
| 10 | +- **Before**: `maven-compiler-plugin` 3.1 with `<source>1.9</source>` / `<target>1.9</target>` |
| 11 | +- **After**: `maven-compiler-plugin` 3.11.0 with `<release>11</release>` |
| 12 | +- Added `<maven.compiler.release>11</maven.compiler.release>` property for IDE tooling |
| 13 | + |
| 14 | +### Plugin Additions |
| 15 | +| Plugin | Version | Purpose | |
| 16 | +|--------|---------|---------| |
| 17 | +| `maven-compiler-plugin` | 3.11.0 | Upgraded from 3.1; uses `<release>` instead of source/target | |
| 18 | +| `maven-surefire-plugin` | 3.2.5 | Test runner compatible with Java 11+ | |
| 19 | +| `maven-enforcer-plugin` | 3.5.0 | Enforces minimum JDK 11 at build time | |
| 20 | +| `maven-javadoc-plugin` | 3.6.3 | Configured with `-Xdoclint:none` for lenient Javadoc | |
| 21 | + |
| 22 | +### Dependency Updates |
| 23 | +| Dependency | Old Version | New Version | Notes | |
| 24 | +|-----------|-------------|-------------|-------| |
| 25 | +| JUnit | 4.11 | 4.13.2 | Latest 4.x release; security and bug fixes | |
| 26 | +| JMH (jmh-core) | 1.17.4 | 1.37 | Latest release; full Java 11+ support | |
| 27 | +| JMH (jmh-generator-annprocess) | 1.17.4 | 1.37 | Kept in sync with jmh-core | |
| 28 | + |
| 29 | +### Encoding |
| 30 | +- `<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>` was already present (retained) |
| 31 | + |
| 32 | +## CI/CD |
| 33 | +- Added `.github/workflows/build.yml` — GitHub Actions workflow running `mvn compile` and `mvn test` on JDK 11 (Temurin) with Maven dependency caching |
| 34 | + |
| 35 | +## Source Code Changes |
| 36 | +- **None required.** The codebase compiled cleanly on Java 11 without any source modifications. |
| 37 | +- No JAXB, JavaFX, JAX-WS, CORBA, or Nashorn APIs are used, so no removals were necessary. |
| 38 | +- No module-info.java was added; the project continues to use the classpath (no JPMS). |
| 39 | + |
| 40 | +## Build Warnings (informational, not errors) |
| 41 | +- `maven-shade-plugin` missing explicit version (pre-existing, not introduced by this migration) |
| 42 | +- Deprecation warning in `lambdasinaction/chap11/Util.java` (pre-existing) |
| 43 | +- Unchecked operations warning in `lambdasinaction/appc/StreamForker.java` (pre-existing) |
| 44 | + |
| 45 | +## Testing |
| 46 | +- No test sources exist in the repository (`src/test/` directory absent) |
| 47 | +- `mvn test` succeeds with "No tests to run" |
| 48 | + |
| 49 | +## Compatibility |
| 50 | +- **Minimum JDK**: 11 (enforced by `maven-enforcer-plugin`) |
| 51 | +- **Build system**: Maven 3.6+ |
| 52 | +- **No breaking changes** to the educational examples |
0 commit comments