Skip to content

Expose the remote JDK's legal/ directory from the generated BUILD file #390

Open

Description

@simonepri

The BUILD file that rules_java generates for remote JDK repositories (toolchains/jdk_build_file.bzl, JDK_BUILD_TEMPLATE) exposes the runtime's bin, conf, lib, include and jmods through filegroups, and exports only WORKSPACE and BUILD.bazel. The archive's legal/ directory is downloaded but not reachable from any target.

Projects that package the remote JDK into a container image and redistribute it need those files: OpenJDK is GPL-2.0 with the Classpath Exception and bundles third-party components whose licenses require their notices to accompany copies. Today the only way to get them is to patch JDK_BUILD_TEMPLATE.

Would you accept exporting them, for example a legal filegroup (glob(["legal/**"], allow_empty = True)) or adding legal/** to exports_files? Observed with rules_java 9.3.0 and remotejdk21_linux. Happy to send a PR.

Activity

  1. added
    P3We're not considering to work on this, but happy to review a PR. (No assignee)
    on Oct 26, 2026
  2. hvadehra commented on Oct 26, 2026

    @hvadehra
    Member

    a legal filegroup (glob(["legal/**"], allow_empty = True))

    This SGTM, please send a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering to work on this, but happy to review a PR. (No assignee)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions