Skip to content

Conversation

@loesak
Copy link
Owner

@loesak loesak commented Jan 30, 2026

Summary

This PR upgrades the project from Java 11 to Java 21 and modernizes the codebase by replacing Lombok @Value annotations with Java records for all domain models. It also updates dependencies and tooling to leverage modern Java features.

Key Changes

Java Version & Tooling

  • Upgraded Java from 11 to 21 across all build configurations (dev container, CI/CD, Maven compiler)
  • Updated Maven compiler configuration to use maven.compiler.release property (Java 9+ best practice)
  • Added explicit Maven compiler and surefire plugin versions to root pom.xml

Domain Model Modernization

  • Converted all domain models to Java records:
    • MigrationRecord - now a record with compact constructor for null validation
    • MigrationLock - now a record with compact constructor for null validation
    • MigrationFile and nested types (MigrationFileMetadata, MigrationFileContents, MigrationFileRequestDefinition) - all converted to records
  • Replaced Lombok @Value and @NonNull with Objects.requireNonNull() in compact constructors
  • Removed @ConstructorProperties annotations (no longer needed with records)
  • Updated all call sites to use record accessor methods (e.g., getMetadata()metadata())

Dependency Updates

  • Elasticsearch client: 7.17.23 → 8.17.0 (now supports Java 21)
  • Jackson: 2.17.2 → 2.18.2 (via new jackson-bom for centralized version management)
  • SLF4J: 2.0.15 → 2.0.17
  • Lombok: 1.18.34 → 1.18.36
  • Logback: 1.5.6 → 1.5.16
  • Maven plugins: Updated javadoc (3.8.0 → 3.11.2), gpg (3.2.4 → 3.2.7), install/deploy (3.1.2 → 3.1.3)

Code Quality Improvements

  • Replaced Collectors.toUnmodifiableList() with Stream.toList() (Java 16+)
  • Removed unnecessary type casts in exception handling
  • Updated documentation to reflect Java 21 and Elasticsearch 8.x support
  • Removed TODO about building separate ES 7.x/8.x artifacts (now unified on 8.x)

Documentation Updates

  • Updated CLAUDE.md to reflect Java 21 requirement and ES 8.x client version
  • Updated dev container description to reference JDK 21
  • Updated architecture documentation to note that domain models are now records

Implementation Details

  • Records provide immutability and reduce boilerplate compared to Lombok @Value
  • Compact constructors in records handle null validation via Objects.requireNonNull()
  • Jackson 2.18+ has native record deserialization support, eliminating need for @ConstructorProperties
  • Jackson BOM import in root pom.xml ensures consistent versions across all Jackson modules
  • All existing functionality preserved; this is a modernization refactor with no behavioral changes

https://claude.ai/code/session_015ESZFHmSSx9fBhLHb5EYoD

claude and others added 2 commits January 30, 2026 16:05
- Java 11 -> 21: update compiler release, CI workflow, devcontainer
- Elasticsearch REST client 7.17.23 -> 8.17.0 (low-level client,
  server-version-agnostic, removes need for dual 7.x/8.x builds)
- Jackson 2.17.2 -> 2.18.2 (managed via jackson-bom in parent POM,
  enables native record deserialization support)
- SLF4J 2.0.15 -> 2.0.17
- Lombok 1.18.34 -> 1.18.36
- Logback 1.5.6 -> 1.5.16
- Explicitly declare maven-compiler-plugin 3.13.0 and
  maven-surefire-plugin 3.5.2
- Update maven-javadoc-plugin 3.8.0 -> 3.11.2
- Update maven-gpg-plugin 3.2.4 -> 3.2.7
- Update maven-install/deploy-plugin 3.1.2 -> 3.1.3
- Convert MigrationRecord, MigrationLock, MigrationFile (and nested
  types) from Lombok @value classes to Java records with compact
  constructors for null validation
- Replace Lombok getter style (getX) with record accessor style (x)
  across all call sites
- Replace Collectors.toUnmodifiableList() with Stream.toList()
- Remove unnecessary @ConstructorProperties annotations
- Update CLAUDE.md to reflect all changes

https://claude.ai/code/session_015ESZFHmSSx9fBhLHb5EYoD
@loesak loesak merged commit 16b9d99 into master Jan 30, 2026
1 check passed
@loesak loesak deleted the claude/update-java-maven-2Glay branch January 30, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants