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
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