Once Bazel is configured to connect to the secure Artifactory cache, you can resolve Bazel module dependencies from your Artifactory repository. You can resolve modules in two ways:
Resolve Modules from Default Registry
Bazel commands automatically resolve modules from the registry you configure in the .bazelrc file.
To resolve Bazel modules from the default registry:
Run this command:
bazel build @<MODULE_NAME>
Where <MODULE_NAME> is the name of the module you want to resolve. For example:
bazel build @rules_go
Resolve Modules from a Specific Registry
If you want to resolve Bazel modules from a different registry than the one specified in the .bazelrc file, you can specify a repository in the command.
To resolve Bazel modules from a specific registry:
Run this command:
bazel build --registry=https://[JFrogPlatformURL]/artifactory/api/bazelmodules/<REPO_NAME> @<MODULE_NAME>Where:
[JFrogPlatformURL]: Your organization's Artifactory hostname<REPO_NAME>: The name of the repository you want to resolve from<MODULE_NAME>: The name of the module you want to resolve
For example:
bazel build --registry=https://company.jfrog.io/artifactory/api/bazelmodules/bazel-modules-remote @rules_go