Expose the remote JDK legal/ directory as a `jdk-legal` filegroup (#393)

Fixes #390.

The BUILD file generated for remote JDK repositories exposes `bin`, `conf`, `include`, `lib` and `jmods` through filegroups, but the downloaded `legal/` directory is not reachable from any target. Projects that redistribute the JDK, for example by packaging it into a container image, need those notices: OpenJDK bundles third-party components whose licenses require them to accompany copies.

This adds a `jdk-legal` filegroup over `legal/**`, following the naming and `allow_empty` convention of the existing `jdk-*` filegroups. It is not added to the `java_runtime` srcs, so runtime runfiles are unchanged.

Closes #393

COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_java/pull/393 from simonepri:export-jdk-legal 01b04b6fe730fda2d0892657d4848d543e1df6f0
PiperOrigin-RevId: 1031244443
Change-Id: Icc59bdbe59f1b9c039db0e74467d239c27834a98
1 file changed
tree: 4fe775d6bec05843dc7a86ba3e33e90872a8ce8c
  1. .bazel_checkout/
  2. .bazelci/
  3. .bcr/
  4. .github/
  5. distro/
  6. examples/
  7. java/
  8. test/
  9. third_party/
  10. toolchains/
  11. .bazelignore
  12. .bazelrc
  13. .gitignore
  14. AUTHORS
  15. BUILD
  16. CODEOWNERS
  17. CONTRIBUTING.md
  18. LICENSE
  19. MODULE.bazel
  20. README.md
  21. renovate.json
  22. WORKSPACE
  23. WORKSPACE.bzlmod
README.md

rules_java

Build status

Java Rules for Bazel https://bazel.build.

Documentation

For a quickstart tutorial, see https://bazel.build/start/java

The fastest way to try this in an empty project is to click the green “Use this template” button on https://github.com/bazel-starters/java.

For slightly more advanced usage, like setting up toolchains or writing your own java-like rules, see https://bazel.build/docs/bazel-and-java

Core Java rules

Add a load like:

load("@rules_java//java:java_library.bzl", "java_library")

to your BUILD / BUILD.bazel / *.bzl files

For detailed docs on the core rules, see https://bazel.build/reference/be/java