9.0.0
Changes since 8.16.1
a27004a Update JDKs to latest patch releases (#335)
76212e6 Include the srcjar (if there is one) in the _validation output group so blaze will check whether the srcjar file actually exists.
402b184 upgrade java_tools to 17.0 and wire up linux aarch64 prebuilts (#334)
36264e4 Update zulu JDKs to latest patch release (#327) (#328)
7ff9193 Fix test class determination error message (#326)
1ed307b Increase maxwarns to -1 (#291)
3257e83 Re-enable ReturnValueIgnored error prone check
6a30ab8 Run the bootclasspath through ijar (#324)
3cbc18e Update abseil-cpp to remove override (#322)
MODULE.bazel setup
bazel_dep(name = "rules_java", version = "9.0.0")
WORKSPACE setup
With Bazel 8.0.0 and before 8.3.0, add the following to your file:
# https://github.com/bazelbuild/bazel/pull/26119
common --repositories_without_autoloads=bazel_features_version,bazel_features_globals
In all cases, add the following to your file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_java",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/9.0.0/rules_java-9.0.0.tar.gz",
],
sha256 = "19008f8a85125c9476ef37b6ad945f665d7178aaab3746f7962917ccd87d2477",
)
http_archive(
name = "bazel_features",
sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
strip_prefix = "bazel_features-1.30.0",
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
)
load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
rules_java_dependencies()
# note that the following line is what is minimally required from protobuf for the java rules
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility
proto_bazel_features(name = "proto_bazel_features")
# register toolchains
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
rules_java_toolchains()
Using the rules
See the source.