Skip to content

Migrate Java 8 to Java 21: update build configs, CI/CD, and documentation - #35

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1772729397-java-8-to-21-migration
Open

devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1772729397-java-8-to-21-migration

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Migrate Java 8 to Java 21: build configs, CI, and docs

Summary

Migrates the project from Java 8 to Java 21 across all build configuration, CI/CD, static analysis settings, and documentation.

Changes by file:

  • pom.xml (root): Added <java.version>21</java.version> property, upgraded maven-compiler-plugin 3.5.1 → 3.11.0, changed <source>/<target> from 1.8 to 21
  • PatentDocument/pom.xml: Changed project.java.version property from 1.8 to 21, upgraded maven-compiler-plugin 3.8.0 → 3.11.0
  • .github/workflows/sonarcloud.yml: Updated setup-java from JDK 17 to JDK 21
  • sonar-project.properties: Updated sonar.java.source and sonar.java.target from 8 to 21
  • README.md: Added Requirements section (Java 21+, Maven 3.9+)

No code changes required: All javax.* imports are either part of JDK core modules still present in Java 21 (java.xml, java.naming) or backed by explicit Maven dependencies (jaxb-api, jaxb-runtime, javax.json). No sun.misc/sun.reflect usage found.

Pre-existing test failures: 3 tests in PatentDocument fail identically on master — not caused by this migration.

Review & Testing Checklist for Human

  • Verify JAXB runtime behavior: BulkDownloader uses javax.xml.bind imports (removed from JDK in Java 11). Explicit jaxb-api + jaxb-runtime dependencies exist, but confirm JAXB unmarshalling works at runtime (e.g., Sources.java loading XML config)
  • Verify Cp1252 encoding still works: PatentDocument/pom.xml uses Cp1252 source encoding — unusual but compiled successfully. Worth a spot-check that patent document parsing behaves correctly with Java 21
  • Note: java.version property in root pom.xml is informational only — the root compiler plugin hardcodes <source>21</source> directly rather than referencing ${java.version}. PatentDocument does reference its property correctly via ${project.java.version}. Decide if you want consistency here.

Recommended test plan: Run the BulkDownloader module's main entry points that exercise JAXB (XML source config loading) and XPath operations to confirm runtime compatibility beyond just compilation.

Notes

  • Compilation verified locally with OpenJDK 21.0.10 — all 4 modules (Common, PatentDocument, BulkDownloader, AuthenticationService) compile successfully
  • No Docker files, Jenkinsfile, or .gitlab-ci.yml were present in the repo
  • Devin Session
  • Requested by: @joao-cognition

…tion

- Update maven-compiler-plugin from 3.5.1 to 3.11.0 with source/target 21 (root pom.xml)
- Update PatentDocument maven-compiler-plugin from 3.8.0 to 3.11.0, java version property to 21
- Add java.version=21 property to root pom.xml
- Update GitHub Actions workflow to use JDK 21 (from JDK 17)
- Update sonar-project.properties java source/target from 8 to 21
- Add Java 21 requirements section to README.md

Co-Authored-By: Joao Esteves <joao.esteves@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants