Use root test_deps target from bazel_skylib

Fixing 
```
$ bazel build //src/test/java/com/google/devtools/build/lib/query2/cquery:FilesOutputFormatterCallbackTest
INFO: Invocation ID: a90dc4d1-9d48-4164-a9d1-7d82a393fc37
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=170
INFO: Reading rc options for 'build' from /Users/pcloudy/workspace/bazel/.bazelrc:
  Inherited 'common' options: --enable_platform_specific_config --check_direct_dependencies=error --downloader_config=bazel_downloader.cfg
INFO: Reading rc options for 'build' from /Users/pcloudy/workspace/bazel/.bazelrc:
  'build' options: --java_runtime_version=21 --java_language_version=21 --tool_java_language_version=21 --tool_java_runtime_version=21
INFO: Reading rc options for 'build' from /Users/pcloudy/.bazelrc:
  'build' options: --verbose_failures --announce_rc --disk_cache=/tmp/bazel_disk_cache --repository_cache=/tmp/bazel_repository_cache
INFO: Found applicable config definition build:macos in file /Users/pcloudy/workspace/bazel/.bazelrc: --host_macos_minimum_os=10.13 --macos_minimum_os=10.13 --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --per_file_copt=external/.*@-w --host_per_file_copt=external/.*@-w
DEBUG: /private/var/tmp/_bazel_pcloudy/829441223e9fec5a5a2e3d1dd743fdf0/external/grpc-java+/java_grpc_library.bzl:201:14: Multiple values in 'deps' is deprecated in build_bazel_remote_execution_v2_remote_execution_java_grpc
ERROR: /private/var/tmp/_bazel_pcloudy/829441223e9fec5a5a2e3d1dd743fdf0/external/rules_java+/java/BUILD:78:10: in filegroup rule @@rules_java+//java:for_bazel_tests: Visibility error:
target '@@bazel_skylib+//lib:test_deps' is not visible from
target '@@rules_java+//java:for_bazel_tests'
Recommendation: modify the visibility declaration if you think the dependency is legitimate. For more info see https://bazel.build/concepts/visibility
```
after upgrading bazel_skylib which contains https://github.com/bazelbuild/bazel-skylib/pull/508
1 file changed
tree: 5a94c04ce9d57f89026551f258b82eb5ee1a77a5
  1. .bazel_checkout/
  2. .bazelci/
  3. .bcr/
  4. .github/
  5. distro/
  6. examples/
  7. java/
  8. test/
  9. toolchains/
  10. .bazelignore
  11. .bazelrc
  12. .gitignore
  13. AUTHORS
  14. BUILD
  15. CODEOWNERS
  16. CONTRIBUTING.md
  17. LICENSE
  18. MODULE.bazel
  19. README.md
  20. renovate.json
  21. WORKSPACE
  22. WORKSPACE.bzlmod
README.md

rules_java

  • Postsubmit Build status
  • Postsubmit + Current Bazel Incompatible Flags Build status

Java Rules for Bazel https://bazel.build.

Documentation

For a quickstart tutorial, see https://bazel.build/start/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