I’ve faced a similar problem when building my project with a tool called Nix, which is designed to ensure “pure” builds by requiring all internet-fetched dependencies to be declared and managed explicitly.
If you take a look at my elm-package.json and the corresponding elm-srcs.nix, you can see that each dependency’s exact URL and checksum are declared. (These are plain https URLs that could presumably be cached for you by artifactory.)
These artifacts are fetched by nix, then the elm-stuff directory is created from them: elm-stuff/exact-dependencies.json is constructed here and then the elm-stuff/packages/ subdir is populated here.
The elm2nix project automates the derivation of default.nix and elm-srcs.nix from your elm-package.json.
This obviously requires some reverse-engineering of elm-stuff, so it’s definitely not robust across releases of Elm. (Indeed, from what I’ve heard of 0.19 I’d say it’s pretty much guaranteed to stop working in that release.
) However, elm2nix is built on top of elm-package, and I’ve found it useful enough over the past several months to make the tradeoff of future breakage worthwhile.