bazel-contrib / bazel-contrib/rules_jvm_external

[bzlmod] Cross-module artifact resolution (single-version policy)

Open
#995 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
373
Forks
301
Avg merge
7d 17h
Merged PRs (30d)
3

Description

Can some documentation be included on the right way to use the module extension when rules_jvm_external is used by multiple dependencies or by a dependency and the root module?

Example dependency graphs, where "->" indicates "depends on":

1. B -> A
2. C -> B -> A
3. C -> A and C -> B

Supposing each of A, B, and C above use the module extension to include Maven artifacts. What is the right way to configure the modules such that they share Maven artifact resolution (i.e. if both A and B include some Maven artifact X we only get one copy/version of X)?

In WORKSPACE mode, we handle this by having each project expose its list of artifacts and only having the root WORKSPACE call `maven_install`.

Contributor guide

Open the contributing guide

Research direction

Start from the module extension behavior described in the issue and trace the three dependency graphs: B -> A, C -> B -> A, and C -> A plus C -> B. Compare this with the existing WORKSPACE approach using a root maven_install, then document the configuration that shares Maven artifact resolution across modules and include examples for each graph.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.