Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure CLI by

In Cursive's new deps integration, I invoke make-classpath2 from within IntelliJ, which means that the CWD is not the project directory. I bind clojure.tools.deps.util.dir/*the-dir* when I do this, and most things work correctly. However, there are some exceptions which don't work:

  • :mvn/local-repo
  • :local/root deps inside :override-deps
  • :classpath-overrides

It would be nice if they could be made to work too. If there's interest in a patch for this I could have a go at it.

1 Answer

0 votes

This should not be considered a public api - it changes regularly in breaking ways, and using it for any directory other than the current directory is not supported (this is only called from the CLI, which assumes current directory).

To programmatically make a classpath from deps.edn, you should use clojure.tools.deps/create-basis (which can specify a project deps.edn in any directory).

This is for the new integration in Cursive, which uses deps.clj. That calls make-classpath2, and if I want to re-work that to call `create-basis` then I have to duplicate a ton of machinery from make-classpath2, such as all the tool handling. My main objective with this change was to avoid that. I'll find another approach.