bazel-contrib / bazel-contrib/rules_jvm
Cannot be used with `--override_repository`: cannot load '@@rules_java//java:repositories.bzl': no such file
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 54
- Forks
- 98
- Avg merge
- 6d 2h
- Merged PRs (30d)
- 7
Description
We are using `rules_jvm` without problems with this in the workspace:
```
load("@contrib_rules_jvm//:repositories.bzl", "contrib_rules_jvm_deps")
contrib_rules_jvm_deps()
load("@contrib_rules_jvm//:setup.bzl", "contrib_rules_jvm_setup")
contrib_rules_jvm_setup()
```
However, as soon as we add `--override_repository= rules_jvm=/path/to/rules_jvm` the build fails with:
```
ERROR: Error computing the main repository mapping: at /Users/.../.cache/bazel/.../external/contrib_rules_jvm/setup.bzl:4:6: cannot load '@@rules_java//java:repositories.bzl': no such file
Computing main repo mapping:
Fetching repository @@contrib_rules_jvm_deps; starting
```
Note, the outer build is running with `--noenable_bzlmod` (Bazel 7.0.1) because we have not migrated yet.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the WORKSPACE loading sequence and the external contrib_rules_jvm/setup.bzl location shown in the error, then reproduce under Bazel 7.0.1 with --noenable_bzlmod and --override_repository. Investigate why the override cannot load @rules_java//java:repositories.bzl; done means the override works without that repository-mapping failure while preserving the existing setup.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100