bazelbuild / rules_jvm_external

Bazel rules to resolve, fetch and export Maven artifacts
Apache License 2.0
316 stars 236 forks source link

Add support for BOM priotization #1155

Closed tharakadesilva closed 1 week ago

tharakadesilva commented 1 month ago

With the current code, if multiple BOMs have the same coords, the coordinates would be resolved through all the BOMs when we try to resolve the artifact versions. ~When two or more versions were present, Maven resolver would resort to the lower version (IIUC, default Maven behavior).~ The issue was that the set that was created was not ordered, so it would not give priority to the first defined BOM.

~With these changes, we will ignore the artifact if it was previously found, thus giving priority to the BOM that was defined first.~

We now have a LinkedHashSet that will maintain the ordering so that the BOMs will be given priority based on the order they were defined.


Closes https://github.com/bazelbuild/rules_jvm_external/issues/1146.

tharakadesilva commented 1 month ago

I am yet to add any tests, will do that once I've received the go-ahead on the strategy.

tharakadesilva commented 1 month ago

@cheister for the tests, I am thinking of something like this:

Do you have any thoughts on this?

cheister commented 4 weeks ago

Do you have any thoughts on this?

That sounds good to me