bazel: incompatible_load_java_rules_from_bzl: load the Java rules from @rules_java
Flag: --incompatible_load_java_rules_from_bzl Available since: 0.28 Will be flipped in: 1.0 Tracking issue: #8741
java_library, java_binary, java_test, java_import, java_lite_proto_library, java_proto_library, java_package_configuration, java_plugin, java_runtime, java_toolchain have to be loaded from @rules_java.
For example if you are using java_library, add the following load statement to your BUILD/bzl file. load(“@rules_java//java:defs.bzl”, “java_library”)
Migration
Add rules_java
repositories to your WORKSPACE file and load its dependecies:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_java",
url = "https://github.com/bazelbuild/rules_java/releases/download/0.1.1/rules_java-0.1.1.tar.gz",
sha256 = "220b87d8cfabd22d1c6d8e3cdb4249abd4c93dcc152e0667db061fb1b957ee68",
)
load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
rules_java_dependencies()
rules_java_toolchains()
Fix all your BUILD files that use Java rules to include the load statement. Use buildifier to automatically update all your BUILD files:
buildifier --lint=fix -warnings=native-java -r path/to/your/workspace/root/dir
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (16 by maintainers)
Commits related to this issue
- Add incompatible flag to forbid loading the native Java rules. RELNOTES: --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue... — committed to bazelbuild/bazel by iirina 5 years ago
- Use java macros in java_tools. `@rules_java` repository is now available to all Bazel java users. There is the possibility to override the repository in the users' WORKSPACE file in order to safely m... — committed to bazelbuild/bazel by iirina 5 years ago
- Add incompatible flag to forbid loading the native Java rules. RELNOTES: --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue... — committed to siberex/bazel by iirina 5 years ago
- Use java macros in java_tools. `@rules_java` repository is now available to all Bazel java users. There is the possibility to override the repository in the users' WORKSPACE file in order to safely m... — committed to siberex/bazel by iirina 5 years ago
- Release 0.28.0 (2019-07-10) Baseline: 2e374a9c6e3d4ed71f0145de287c4b2fe43c76d6 Cherry picks: + 6d0b14b95a71175362030b4811ca74512b00a890: rule_test: apply "tags" to all rules in the macro I... — committed to bazelbuild/bazel by a-googler 5 years ago
- Add incompatible flag to forbid loading the native Java rules. RELNOTES: --incompatible_load_java_rules_from_bzl was added to forbid loading the native java rules directly. See more on tracking issue... — committed to irengrig/bazel by iirina 5 years ago
- Use java macros in java_tools. `@rules_java` repository is now available to all Bazel java users. There is the possibility to override the repository in the users' WORKSPACE file in order to safely m... — committed to irengrig/bazel by iirina 5 years ago
- Release 0.28.0 (2019-07-10) Baseline: 2e374a9c6e3d4ed71f0145de287c4b2fe43c76d6 Cherry picks: + 6d0b14b95a71175362030b4811ca74512b00a890: rule_test: apply "tags" to all rules in the macro I... — committed to irengrig/bazel by a-googler 5 years ago
- Release 0.28.0 (2019-07-10) Baseline: 2e374a9c6e3d4ed71f0145de287c4b2fe43c76d6 Cherry picks: + 6d0b14b95a71175362030b4811ca74512b00a890: rule_test: apply "tags" to all rules in the macro I... — committed to bazelbuild/bazel by a-googler 5 years ago
- Add rules_java load statements. Migrate bazel to use the Java rules from the rules_java repository. Progress on #8746. Closes #9092. PiperOrigin-RevId: 262316492 — committed to bazelbuild/bazel by iirina 5 years ago
- Add rules_java load statements. Progress on #8746. RELNOTES: None. PiperOrigin-RevId: 262331235 — committed to bazelbuild/bazel by iirina 5 years ago
- Add rules_java load statement to jdk.BUILD. Progress on #8746. RELNOTES: None. PiperOrigin-RevId: 262333530 — committed to bazelbuild/bazel by iirina 5 years ago
- Automated rollback of commit acd1bbb7a9260f5a40e580062c004d1b978b3311. *** Reason for rollback *** TAP has detected 10 or more targets failed to build at https://github.com/bazelbuild/bazel/commit/a... — committed to bazelbuild/bazel by a-googler 5 years ago
@iirina Can we update the description to include the load statement so users will know to include them?