clj -Scp is an option to provide an explicit classpath and override the classpath calculation. Right now, if the staleness checks fail, the classpath and other files will still be computed and cached in the .cpcache dir, but that shouldn't happen.
Need to fix the flag checks in the clojure script to avoid cp calculation if -Scp is set.
here’s a patch (TDEPS-150.patch) that worked for me on nixpkgs where any calls to maven were unwanted. By checking for emptieness (-z) of the -Scp data ($force_cp), it will skip the clojure.tools.deps.alpha.script.make-classpath2 section and make no attempts to make network requests to Maven.
I did some more looking at this and the script is not the right place to fix this. Cutting off the tools call prevents correct operation of jvm and main opts as they get set up during the tools operation. So, have not applied the patch here.
However, fixed the actual fix in make-classpath2, which was a regression during some refactoring, and added a test. Will be in next build of tools.deps.
Released in tools.deps.alpha 0.8.677