I am using Bazel on a codebase that uses SpringBoot and JUnit in an airgapped environment. Here are the commands I need to run in order to fetch all the third-party dependencies:
bazel fetch '@bazel_tools//tools/build_defs/repo:*'
bazel fetch '@rules_java//java:*'
bazel fetch '@rules_cc//cc:*'
bazel fetch @local_config_platform//...
bazel fetch @local_config_sh//...
bazel fetch @maven//...
bazel fetch @org_opentest4j_opentest4j//jar:jar
bazel fetch @org_junit_jupiter_junit_jupiter_params//jar:jar
bazel fetch @org_junit_jupiter_junit_jupiter_engine//jar:jar
bazel fetch @org_junit_platform_junit_platform_console//jar:jar
bazel fetch @org_junit_platform_junit_platform_engine//jar:jar
bazel fetch @org_junit_platform_junit_platform_commons//jar:jar
bazel fetch @org_junit_platform_junit_platform_suite_api//jar:jar
bazel fetch @org_junit_platform_junit_platform_launcher//jar:jar
bazel fetch @org_apiguardian_apiguardian_api//jar:jar
bazel fetch @remote_coverage_tools//:coverage_report_generator
bazel fetch @remotejdk11_linux//:jdk
How do I make these dependencies available in an airgapped environment (where I cannot download things from the internet)? Does Bazel have a command that creates a download cache for third-party dependencies similar to https://docs.bazel.build/versions/master/guide.html#running-bazel-in-an-airgapped-environment? Said another way, can Bazel populate a directory that can be shared with other machines and used via --distdir there? Are there other ways to share Bazel's download cache?