New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bzlmod] Cross-module artifact resolution (single-version policy) #995
Comments
Another way to phrase this would be "how to enforce a single-version policy for all Maven artifacts" |
Concrete example of this causing build headaches yesterday:
The only workaround I've found is to ensure that all of my projects that use rules_jvm_external use the same repo name in the Maven extension. This of course results in lots of warnings, and is also only possible if I don't end up with two module deps I don't control that use different names. |
This ensures a single version for library dependencies that come from Maven. See bazelbuild/rules_jvm_external#1035 (comment) and bazelbuild/rules_jvm_external#995.
The way to share artifacts is to use the same When run, we aggregate all the artifacts from tags with the same name (that is, module A can contribute to dependencies that module B can use). This is needed because For lock files, if the root module specifies a lock file, that is the one that is used. |
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":
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
.The text was updated successfully, but these errors were encountered: