Clone this repo:

Branches

  1. 22dd431 Remove `_LEGACY_ANY_TYPE_ATTRS` workaround in `java_toolchain`. by Googler · 20 hours ago master
  2. 366b5b3 Fix rules_java CI after https://github.com/bazel-contrib/buildtools/releases/tag/v10.2.0 by Googler · 25 hours ago
  3. a61f1f0 Add a test for `java_binary` deploy jars and neverlink transitivity by Googler · 2 days ago
  4. 575fa89 Add a test that `java_binary` `runtime_deps` are not added to the compilation classpath by Googler · 3 days ago
  5. ab7a789 Add a test for `java_binary` runtime_deps with java_import by Googler · 4 days ago

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