Skip to content

Releases: bazelbuild/rules_java

8.13.0

20 Jun 09:21
Compare
Choose a tag to compare

Changes since 8.12.0
d1e335a Release rules_java v8.13.0
c289c72 Update java_tools v15.0
d927aa0 Fix Runfiles docs after #301 (#302)
1a2c184 use DefaultInfo in rules_java (#303)
1947744 Add support for --incompatible_compact_repo_mapping_manifest (#301)
fecb9fb Remove a reference to incompatible_disallow_java_import_empty_jars after unknown commit
a75e722 In make_non_strict, header_compilation_direct_deps should be the same as compile_jars, not full_compile_jars
ae8a5b2 Initial support for header compilation direct deps
899c2b7 Improve the error message for no matching bootclasspath (#296)
0af04ab Replace asserts on library_identifier with static_library

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.13.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/8.13.0/rules_java-8.13.0.tar.gz",
    ],
    sha256 = "b6c6d92ca9dbb77de31fb6c6a794d20427072663ce41c2b047902ffcc123e3ef",
)

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

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

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

8.12.0

23 May 09:36
Compare
Choose a tag to compare

IMPORTANT: Bazel 8 users still using WORKSPACE please note the change in the setup below.

Changes since 8.11.0
808f849 Use the launcher_maker toolchain if available (#294)
042e9a6 Use @platforms//host instead of @local_config_platform
4ce6ca9 Validate java_common.compile(strict_deps) in Starlark
94426d1 Fix case handling of java_common.compile(strict_deps)
1d2eecd Remove support for empty jars attribute from java_import
86962f9 Change deprecation message to be more helpful for java_proto_library/java_lite_proto_library
9fac3ac Configure coverage helpers for the test exec group (#292)
4b5e2a9 Fix empty jars check for Bazel java_import
ad510ed Remove usages of --incompatible_disable_non_executable_java_binary
2779574 The test_class of a java_test for JUnit4 does not have to have @RunWith.
bf2fb43 Fix comment
da9eee2 Fix classpath separator when cross-compiling from Windows to Unix (#290)
bd9c5f8 Change type of output_licenses from attr.license to attr.string_list.
804e93e Update to java_tools v14.0 (#286)
05ee692 Add ppc64le platform support (#274)
1b5a8b2 Set use_default_shell_env = True consistently. (#276)

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.12.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/8.12.0/rules_java-8.12.0.tar.gz",
    ],
    sha256 = "1558508fc6c348d7f99477bd21681e5746936f15f0436b5f4233e30832a590f9",
)

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

load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()

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

7.12.5

25 Mar 12:27
9b24456
Compare
Choose a tag to compare

New Features

Incompatible Changes

Change Log

WORKSPACE setup

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/7.12.5/rules_java-7.12.5.tar.gz",
    ],
    sha256 = "17b18cb4f92ab7b94aa343ce78531b73960b1bed2ba166e5b02c9fdf0b0ac270",
)
load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
rules_java_dependencies()
rules_java_toolchains()

Using the rules

See the source.

8.11.0

13 Mar 08:14
Compare
Choose a tag to compare

Changes since 8.10.0
c100754 Update rules_java to 8.11.0 and java_tools to 13.18 (#280)
16e6f4d Test with Bazel 8 for rules_java BCR releases
ca202de Improve rules_java CI config
aef7514 Add java_library outputs to validation outputs

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.11.0")

WORKSPACE setup

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/8.11.0/rules_java-8.11.0.tar.gz",
    ],
    sha256 = "d31b6c69e479ffa45460b64dc9c7792a431cac721ef8d5219fc9f603fa2ff877",
)

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.

8.10.0

04 Mar 09:56
Compare
Choose a tag to compare

Changes since 8.9.0
8b3a998 Release @rules_java v8.10.0
784f519 Update java_tools v13.17
e829603 Add a separate config for Bazel 8 to rules_java CI
250bbdc Switch rules_java back to more named params (quasi-rollback of unknown commit)
31edc44 Add make variables for runfiles location of $(JAVABASE) to support --no_legacy_external_runfiles. (#272)
02ab5e6 Delete toolchains/BUILD.java_tools.
6090866 Extract legacy native symbols to a separate bzl file
af504cf Rename extra_processor_classes to processor_classes for processor bundle support
6f2db13 Enforce checkLegalityOfPluginOptions check on -AgeneratesKotlin javacopts.

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.10.0")

WORKSPACE setup

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/8.10.0/rules_java-8.10.0.tar.gz",
    ],
    sha256 = "476bd403f284e5080037f1910a29ce4c482ac798a3560c2e0df6d6f1857011b6",
)

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.

8.9.0

06 Feb 17:00
Compare
Choose a tag to compare

Changes since 8.8.0
34d7e1b Update rules_java to 8.9.0 and java_tools to 13.16
9d2f73e Ignore the exec_group_compatible_with attribute in java_binary transitive validation collection
93fdd8a Add a test asseting that the JavaInfo returned by java_binary targets are marked as such.
4aa6673 Improve android_support_tests.bzl

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.9.0")

WORKSPACE setup

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/8.9.0/rules_java-8.9.0.tar.gz",
    ],
    sha256 = "8daa0e4f800979c74387e4cd93f97e576ec6d52beab8ac94710d2931c57f8d8b",
)

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.

8.8.0

30 Jan 11:33
Compare
Choose a tag to compare

Changes since 8.7.2
c69bae2 Update rules_java to 8.8.0 and java_tools to 13.15
ba93bb2 Reorganize @rules_java//java/test and @rules_java//test/ to mirror the directory layout of the code paths they exercise

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.8.0")

WORKSPACE setup

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/8.8.0/rules_java-8.8.0.tar.gz",
    ],
    sha256 = "f79a6e10cdd213ceded45884914bb8c68f0c8d41144e74ec89ebb74984c409ac",
)

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.

8.7.2

24 Jan 09:57
Compare
Choose a tag to compare

Changes since 8.7.1
f26a240 Release @rules_java v8.7.2
5d36db2 Make java_stub_template.txt visible to @bazel_tools
61be667 Load CcInfo from @rules_cc

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.7.2")

WORKSPACE setup

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/8.7.2/rules_java-8.7.2.tar.gz",
    ],
    sha256 = "b0b8b7b2cfbf575112acf716ec788847929f322efa5c34195eb12a43d1df7e5c",
)

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.

8.7.1

17 Jan 11:15
Compare
Choose a tag to compare

Changes since 8.7.0
b2a4426 Release @rules_java v8.7.1
ff22cba Stop wrapping JavaInfo into native instances
90aad63 Make java_stub_template.txt visible to Bazel tests

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.7.1")

WORKSPACE setup

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/8.7.1/rules_java-8.7.1.tar.gz",
    ],
    sha256 = "52e7c1f297bb0c5bcbc79743922682071f6968738e73a2a039b92bad9278a469",
)

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.

8.7.0

14 Jan 22:34
Compare
Choose a tag to compare

Changes since 8.6.3
503773e Update rules_java to 8.7.0 and java_tools to 13.14
b4b0466 Move java_stub_template.txt out of Bazel and into @rules_java
4e2b65f Fix buildifier warning suppression for @rules_java
43ca043 Add JDK 21 toolchain for linux_riscv64
97177fb Mark compatibility_proxy extension as reproducible

MODULE.bazel setup

bazel_dep(name = "rules_java", version = "8.7.0")

WORKSPACE setup

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/8.7.0/rules_java-8.7.0.tar.gz",
    ],
    sha256 = "5449ed36d61269579dd9f4b0e532cd131840f285b389b3795ae8b4d717387dd8",
)

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.