Skip to content

Support Temurin JDKs with JMOD files - #1149

Merged
brunoborges merged 5 commits into
mainfrom
copilot/support-temurin-jmod-distribution
Jul 28, 2026
Merged

Support Temurin JDKs with JMOD files#1149
brunoborges merged 5 commits into
mainfrom
copilot/support-temurin-jmod-distribution

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description:
Temurin JDK 24+ excludes JMOD files from its default archive. This adds opt-in installation of Adoptium's matching JMOD artifact through the existing java-package input.

  • Adds the Temurin-specific java-package: jdk+jmods variant.
  • Downloads the matching JDK and JMOD artifacts, then merges the JMODs into the installed JDK.
  • Uses a distinct tool-cache entry for JDKs that include JMODs.
  • Rejects jdk+jmods for unsupported distributions.
  • Documents usage and adds focused coverage.
with:
  distribution: temurin
  java-version: '25'
  java-package: jdk+jmods

Related issue:
#804

Check list:

  • Ran npm run check locally (format, lint, build, test) and all checks pass.
  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Copilot AI linked an issue Jul 28, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add jmod option for Temurin distribution configuration Support Temurin JDKs with JMOD files Jul 28, 2026
Copilot AI requested a review from brunoborges July 28, 2026 21:05
@brunoborges
brunoborges marked this pull request as ready for review July 28, 2026 22:12
@brunoborges
brunoborges requested a review from a team as a code owner July 28, 2026 22:12
Copilot AI review requested due to automatic review settings July 28, 2026 22:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds an opt-in jmod input to support installing Temurin JDKs with JMOD files (needed because Temurin JDK 24+ no longer includes JMODs in the default JDK archive). It extends the Temurin installer to optionally download the matching Adoptium “jmods” artifact, merge it into the installed JDK, and cache that JDK separately.

Changes:

  • Adds a new jmod boolean input (action input + constants + wiring into installer options).
  • Extends Temurin installation to optionally download and merge the “jmods” image and cache it under a distinct toolcache folder suffix.
  • Updates docs and adds focused Temurin installer test coverage for the new behavior.
Show a summary per file
File Description
src/setup-java.ts Reads jmod input and passes it through installer options.
src/distributions/temurin/installer.ts Implements optional JMOD download/merge and toolcache folder suffixing.
src/distributions/base-models.ts Adds optional jmod?: boolean to installer options model.
src/constants.ts Adds INPUT_JMOD constant.
action.yml Exposes jmod as a supported action input.
docs/advanced-usage.md Documents jmod: true usage for Temurin.
tests/distributors/temurin-installer.test.ts Adds tests for image_type=jmods, toolcache folder naming, and JMOD merge path.
dist/setup/index.js Updates compiled distribution output for setup action.
dist/cleanup/index.js Updates compiled distribution output for cleanup action constants.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 7/9 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread src/distributions/temurin/installer.ts
Comment thread src/distributions/temurin/installer.ts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e7d8c581-2d14-4ccc-aeca-afc0f3b0c2bc
Use platform-aware path construction for the JMOD copy and cache assertions so the Windows test expects backslash-normalized paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@brunoborges
brunoborges force-pushed the copilot/support-temurin-jmod-distribution branch from eeae934 to 5573c3d Compare July 28, 2026 22:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Comments suppressed due to low confidence (2)

src/distributions/temurin/installer.ts:180

  • The JMODs archive extracted from Adoptium uses a JDK-like top-level directory that itself contains a jmods/ subdirectory. Copying the extracted root directory into ${javaHome}/jmods will nest paths (e.g., ${javaHome}/jmods/<extracted-root>/jmods/...) rather than placing the .jmod files directly under ${javaHome}/jmods.

Copy the jmods directory from within the extracted artifact (and account for macOS Contents/Home) instead of copying the artifact root.

    const jmodsDirectory = path.join(
      extractedJmodsPath,
      fs.readdirSync(extractedJmodsPath)[0]
    );
    fs.cpSync(jmodsDirectory, path.join(javaHome, 'jmods'), {recursive: true});

tests/distributors/temurin-installer.test.ts:520

  • This test asserts the fs.cpSync source as the extracted artifact root (.../jdk-25-jmods). With the intended behavior of merging JMODs into the JDK, the copy source should be the jmods directory inside the extracted artifact (and Contents/Home/jmods on macOS). Update the expectation to match the correct copy semantics.
    );
    expect(spyCopySync).toHaveBeenCalledWith(
      path.join('/tmp/extracted-jmods', 'jdk-25-jmods'),
      process.platform === 'darwin'
        ? path.join('/tmp/extracted', 'jdk-25', 'Contents', 'Home', 'jmods')
        : path.join('/tmp/extracted', 'jdk-25', 'jmods'),
      {recursive: true}
  • Files reviewed: 7/8 changed files
  • Comments generated: 0 new
  • Review effort level: Low

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 7/8 changed files
  • Comments generated: 0 new
  • Review effort level: Low

@brunoborges
brunoborges merged commit 1c3b3d2 into main Jul 28, 2026
742 of 743 checks passed
@brunoborges
brunoborges deleted the copilot/support-temurin-jmod-distribution branch July 28, 2026 22:39
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.

Support Temurin JMOD distribution

3 participants