Skip to content

Conversation

Copy link

Copilot AI commented Dec 29, 2025

Migrates the project from JDK 8 to JDK 17, updating build configuration, CI/CD pipelines, and documentation to require Java 17 or higher.

Changes

Build Configuration (pom.xml)

  • Set maven.compiler.source and maven.compiler.target to 17
  • Updated Maven enforcer plugin to require [17,) (Java 17+)
  • Added --add-exports=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED to compiler and surefire configurations via Maven property java.exports.arg to maintain access to internal Xerces classes used by XmlUtilsSunXercesHelper

CI/CD Pipeline

  • Updated GitHub Actions matrix to test on JDK 17 and 21 (removed JDK 11)

Documentation

  • Added Requirements section to README.md specifying Java 17+ requirement

Technical Notes

The codebase relies on internal JDK Xerces classes (com.sun.org.apache.xerces.internal.dom.*) which are not exported in the Java Platform Module System. The --add-exports flag provides the necessary access while maintaining compatibility with the existing implementation. Expected compiler warnings about internal proprietary API usage are acceptable for this approach.

Original prompt

Objective

Migrate the HtmlUnit project from its current JDK version to JDK 17.

Required Changes

1. Build Configuration Updates

  • Update Maven pom.xml files to set Java source and target version to 17
  • Update maven.compiler.source and maven.compiler.target properties to 17
  • Update any release configuration to 17
  • Review and update Maven compiler plugin configuration

2. CI/CD Pipeline Updates

  • Update GitHub Actions workflows to use JDK 17
  • Update any CI configuration files (e.g., .github/workflows/*.yml) to use Java 17
  • Ensure build matrices include JDK 17 as the target version

3. Documentation Updates

  • Update README.md to reflect JDK 17 requirement
  • Update any developer documentation mentioning Java version requirements
  • Update contribution guidelines if they reference Java versions

4. Code Changes

  • Review and update code to leverage JDK 17 features where appropriate
  • Remove any workarounds that were needed for older JDK versions
  • Ensure code is compatible with JDK 17 APIs
  • Update or remove any deprecated API usage that was removed in JDK 17

5. Dependency Updates

  • Review and update dependencies to versions compatible with JDK 17
  • Check for any dependencies that require updates for JDK 17 compatibility

6. Configuration Files

  • Update any IDE configuration files (.idea, .eclipse, etc.) if present
  • Update Docker files if they specify Java versions
  • Update any other configuration files that reference Java versions

Testing Requirements

  • Ensure all existing tests pass with JDK 17
  • Verify the build completes successfully with JDK 17
  • Check that no warnings or deprecations are introduced

Acceptance Criteria

  • Project builds successfully with JDK 17
  • All tests pass
  • CI/CD pipelines use JDK 17
  • Documentation is updated to reflect JDK 17 requirement
  • No compilation warnings related to the JDK version change

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 29, 2025 11:03
Co-authored-by: rbri <2544132+rbri@users.noreply.github.com>
… 17+

Co-authored-by: rbri <2544132+rbri@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate HtmlUnit project to JDK 17 Migrate HtmlUnit to JDK 17 Dec 29, 2025
Copilot AI requested a review from rbri December 29, 2025 11:10
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