rules_jvm_external icon indicating copy to clipboard operation
rules_jvm_external copied to clipboard

In BzlMod, overrides are not repo-specific

Open Jonpez2 opened this issue 8 months ago • 5 comments

When using bzlmod, if you invoke

maven.override( name = "repo1", coordinates = "foo.bar:baz", target = "//foo/bar:baz", )

and then invoke maven.install twice:

maven.install( name = "repo1", ... )

maven.install( name = "repo2", ... )

Then the override is applied to both repo1 and repo2.

It is unclear to me whether this is intended behaviour. I think it isn't, as the parameter 'name' (which I had assumed was intended to point to a 'name' in maven.install(...)) appears to be dropped in the override accumulation logic here https://github.com/bazelbuild/rules_jvm_external/blob/5393477ae7371b21ed0d97fe8202963e206efab8/private/extensions/maven.bzl#L232

My usecase is that I need support a configuration with an overridden dependency, as well as a configuration with the un-overridden dependency. Pre-bzlmod, I did that with two repos, which did not interfere with each other.

Thank you!

Jonpez2 avatar Jun 22 '24 07:06 Jonpez2