These are the basic functions to get started.
To use these functions, load them at the top of your BUILD file. For example:
load("@rules_jvm_external//:defs.bzl", "maven_install", "artifact")
Resolves and fetches artifacts transitively from Maven repositories.
This macro runs a repository rule that invokes the Coursier CLI to resolve and fetch Maven artifacts transitively.
Supports URLs with HTTP Basic Authentication, e.g. “https://username:password@example.com”. artifacts optional. default is [] A list of Maven artifact coordinates in the form of group:artifact:version. fail_on_missing_checksum optional. default is True fetch_sources optional. default is False Additionally fetch source JARs. use_unsafe_shared_cache optional. default is False Download artifacts into a persistent shared cache on disk. Unsafe as Bazel is currently unable to detect modifications to the cache. excluded_artifacts optional. default is [] A list of Maven artifact coordinates in the form of group:artifact to be excluded from the transitive dependencies. generate_compat_repositories optional. default is False Additionally generate repository aliases in a .bzl file for all JAR artifacts. For example, @maven//:com_google_guava_guava can also be referenced as @com_google_guava_guava//jar. maven_install_json optional. default is None A label to a maven_install.json file to use pinned artifacts for generating build targets. e.g //:maven_install.json.
These are helper functions to specify more information about Maven artifacts and repositories in maven_install.
To use these functions, load the maven struct at the top of your BUILD file:
load("@rules_jvm_external//:specs.bzl", "maven")
Generates the data map for a Maven repository specifier given the available information.
If both a user and password are given as arguments, it will include the access credentials in the repository spec. If one or both are missing, it will just generate the repository url.
Generates the data map for a Maven artifact given the available information about its coordinates.
Generates the data map for a Maven artifact exclusion.