- From: Java 9 (source/target 1.9)
- To: Java 11 (using
<release>11</release>) - The
<release>flag replaces the legacy<source>/<target>configuration and provides stronger cross-compilation guarantees.
| Plugin | Old Version | New Version | Notes |
|---|---|---|---|
| maven-compiler-plugin | 3.1 | 3.11.0 | Switched from source/target to release flag |
| maven-surefire-plugin | (none) | 3.2.5 | Added for test execution |
| maven-failsafe-plugin | (none) | 3.2.5 | Added for integration test support |
| maven-enforcer-plugin | (none) | 3.5.0 | Added to enforce Java 11+ at build time |
| maven-javadoc-plugin | (none) | 3.6.3 | Added with <doclint>none</doclint> (Java 11 doclint is stricter) |
| maven-shade-plugin | (unversioned) | 3.6.2 | Pinned explicit version (was unversioned, which Maven warns is unstable) |
Build encoding is pinned to UTF-8 for both source (project.build.sourceEncoding) and reporting (project.reporting.outputEncoding).
| Dependency | Old Version | New Version | Notes |
|---|---|---|---|
| JUnit | 4.11 | 4.13.2 | Latest JUnit 4.x; added <scope>test</scope> |
| JMH (jmh-core) | 1.17.4 | 1.37 | Java 11 compatible |
| JMH (jmh-generator-annprocess) | 1.17.4 | 1.37 | Java 11 compatible |
Minimal changes were needed:
- Moved
ReadPositiveIntParam.javafromsrc/main/javatosrc/test/java— this file contained JUnit@Testannotations but was incorrectly placed in the main source tree. With JUnit correctly scoped totest, it must reside undersrc/test/java. - No Nashorn JavaScript engine references found
- No internal
sun.*orcom.sun.*API usage - No Java EE modules (removed in Java 11) were used
- Deprecation warning in
Util.java(deprecated API usage) — informational only, no breaking change
Added integration tests covering core chapters:
| Test File | Chapter | Coverage |
|---|---|---|
FilteringApplesTest.java |
Chapter 1 | Lambda expressions, method references, Predicate-based filtering |
StreamBasicsTest.java |
Chapter 4 | Stream creation, filtering, sorting, Java 7 vs Java 8 comparison |
StreamProcessingTest.java |
Chapter 5 | Trader/Transaction queries, reduce, distinct, anyMatch |
OptionalTest.java |
Chapter 10 | Optional creation, map, flatMap, orElse, filter, stream() |
CompletableFutureTest.java |
Chapter 11 | supplyAsync, thenApply, thenCombine, thenCompose, exceptionally |
DateTimeTest.java |
Chapter 12 | LocalDate, LocalTime, LocalDateTime, Duration, TemporalAdjusters, DateTimeFormatter |
- GitHub Actions workflow (
.github/workflows/ci.yml) - Triggers on push/PR to master/main branches
- Uses Temurin JDK 11 with Maven caching
- Runs
mvn -B clean compileandmvn -B test