bazelbuild / rules_jvm_external

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

Consolidate maven versions of classifiers for an artifact #1179

Closed cheister closed 1 day ago

cheister commented 1 week ago

We only allow one version for a dependency and all of its classifier in our json file. If a dependency is declared with different classifiers and different versions then we still want to resolve the same version of the dependency for all of the classifiers.

For example, if you had the dependencies

"io.netty:netty-tcnative-boringssl-static:osx-aarch_64:2.0.61.Final", "io.netty:netty-tcnative-boringssl-static:2.0.47.Final",

we want only one version to be resolved in the json file

"artifacts": {
  "io.netty:netty-tcnative-boringssl-static": {
    "shasums": {
      "jar": "b6f974972c44cd6f9cecabc255290286faac40b6393c66c3c3c0db7f421cc28e",
      "linux-aarch_64": "3614395218ae379cec22ccaa089c4f27b9329a660e0d53c93e7cb12b7a2cee46",
      "linux-x86_64": "4ff9d14f1ec6ccee35b78f53a6f3d9c7c54535aa2a76138311c2f619c5e150e1",
      "osx-aarch_64": "58e0302c9fde3db984c3ff7ee7ec7159dc0320bdb91533cc290e12e40911cd1a",
      "osx-x86_64": "fcfea887f4f0802d363c699b444d504b7109a7cb198ae6845eeff63745e5b0ba",
      "windows-x86_64": "17cd2fa3c63b7ed23edea01c945e55cb7baed1faa0f553732c3f5f56da90b3e0"
    },
    "version": "2.0.61.Final"
  },

In this case, we'll use the first version of the dependency we get in the dependency list