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

0 votes
in tools.deps by
closed by

Hi,

it seems there is a bug with using clj -M:foo with :extra-paths in :aliases the classpath seems to not include the extra-paths

deps.edn

{:aliases
 {:foo
  {:extra-paths ["dev"]
   :main-opts ["-m" "foo"]}}}

dev/foo.clj

(ns foo)

(defn -main
  [& args]
  (println "hello world"))

When running

clj -M:foo

We get

Execution error (FileNotFoundException) at clojure.main/main
(main.java:40). Could not locate foo__init.class, foo.clj or foo.cljc
on classpath.

Full report at: /tmp/clojure-8075946726191297006.edn

Whereas

clj -A:foo -m foo

gives

hello world

this difference is also visible via -Spath

clj -Spath -M:foo

src:/home/mark/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar:/home/mark/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar:/home/mark/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar

clj -Spath -A:foo

dev:src:/home/mark/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar:/home/mark/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar:/home/mark/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar

closed with the note: resolved

1 Answer

+2 votes
by
selected by
 
Best answer

Run clojure -Sdescribe -- you need to be on at least 1.10.1.697 for the updated -M behavior.

by
Agreed, I can't repro on latest.
by
thanks, upgrading fixed the issue indeed!
...