Fork me on GitHub

i have an alias defined in my deps.edn as follows:

  {:extra-deps {com.datomic/ion-dev {:mvn/version "0.9.276"}}
   :main-opts  ["-m" ""]}}
if i run /nix/store/6n60jkgpxb1a95wjx3ikhn9nvp5w33yh-clojure- -A:ion-dev -Sdeps '{:deps {nrepl {:mvn/version "0.8.0"}...' -m nrepl.cmdline ... it complains
WARNING: Use of :main-opts with -A is deprecated. Use -M instead.
WARNING: When invoking clojure.main, use -M
does this mean 1. i have to move the :main-opts into a different alias? 2. the command line should have a -M (without any aliases as a parameter) if i just want to run clojure.main?


im wondering what should be the naming convention for aliases in cases when one want to use some extra dependency both as just a library and as a command-line tool... -A:ion-dev -M:ion-dev/run maybe?


am i supposed to combine aliases which doesn't contain :main-opts with aliases which does? like -M:ion-dev:ion-dev/run? when my deps.edn has:

  {:extra-deps {com.datomic/ion-dev {:mvn/version "0.9.276"}}}

  {:main-opts  ["-m" ""]}}


@onetom needs a -M before the -m, so clojure -A:ion-dev -Sdeps … -M -m nrepl.cmdline …

👍 3

@onetom it is not required to have separate aliases, you can use the original :ion-dev alias and just use -M instead of -A . However, the -M (and -A flags) should come after the -Sdeps option and before the -m option (the -A flag does still work out of position though)

clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.0"}...' -M:ion-dev -m nrepl.cmdline 
It is also possible to chain the aliases under -M , especially if there is an alias for nrepl too (this example taken from
  {:extra-deps {nrepl/nrepl {:mvn/version "0.8.2"}}
   :main-opts  ["-m" "nrepl.cmdline"]}
And then simplify the command
clojure -M:ion-dev:middleware/nrepl


sure, but i need the :extra-path in :ion-dev on its own too, without the :main-opts and so far i haven't found any option combination which wouldn't print some kind of warnings.


i went thru the new deps and cli docs and found this section: but it's unclear to me what does `tool` process refer to.


:replace-deps will just use the deps specified in the alias, dropping any libraries from the main :deps section. This is useful if you just want to run an external tool, e.g. such as clj-new that creates a new Clojure project. Using the -M option only calls the main namespace from the last alias in a chain, so with -M:ion-dev:middleware/nrepl only the main namespace from :middleware/nrep is called and the :ion-dev is simply adding the library as an additional dependency. I didnt see any other main namespaces on the example shared. I am not clear on why an :icon-dev with only extra paths is required in the scenario shared so far.


to start a development repl (with cursive or cider)


but i want to retain the option of running, since that's the official way to deploy datomic cloud projects.


when i have a repl running already (started with repl related :main-opts), im just using{push,deploy,deploy-status} directly

Alex Miller (Clojure team)13:10:33

There is no option to use the extra-deps but not the main-opts from an alias

Alex Miller (Clojure team)13:10:53

You should separate those into two separate aliases if you need that

👍 3

Something in my deps is using a version range or SNAPSHOT because every time I run clj, it runs

Downloading: com/amazonaws/aws-java-sdk-cloudwatch/maven-metadata.xml
. Is there a clj command that will help me find which dep that is?


it’s not -Strace or -Stree, because those only tell me the resolved version

Alex Miller (Clojure team)14:10:12

if you do tree, it's probably whatever is above that dep in the tree ?

Alex Miller (Clojure team)14:10:32

I don't think I have any other magic command to tell you more unfortunately


that helps some, thanks


I was able to find the dep depending on cloudwatch (amazonica), but something else is causing

Downloading: org/clojure/clojure/maven-metadata.xml
. I guess I can wipe out ~/.m2/repository and do some grepping

Alex Miller (Clojure team)14:10:18

alternately, use -Sdeps '{:mvn/local-repo "tmp"}'

Alex Miller (Clojure team)14:10:30

build up a new tmp repository instead

👍 3

found it. de.kotka/lazymap specifies:



should that always trigger a snapshot check?

Alex Miller (Clojure team)16:10:15

all version ranges will trigger a resolution to the "newest" stable version


even when bounded like that?

Alex Miller (Clojure team)16:10:01

you could :exclude org.clojure/clojure down that path

👍 3
Alex Miller (Clojure team)16:10:27

although based on where the canonicalization happens, that may not help


On, I don’t see any definition for the contents of the :exclusion key

Alex Miller (Clojure team)16:10:26

that may be underdocumented :)

Alex Miller (Clojure team)16:10:35

:exclusions [org.clojure/clojure]

Alex Miller (Clojure team)16:10:52

it looks like lazymap 3.1.1 dropped the version range

Alex Miller (Clojure team)16:10:32

I don't think exclusions will help you here

Alex Miller (Clojure team)16:10:12

at the point where expansion goes to resolve the deps, it's resolving all of them, the exclusions and stuff are handled at a higher level


Putting lazymap 3.1.1 as an explicit dependency fixed it for me


lazymap isn’t a dep of my project, it’s a dep of a dep. Putting lazymap in :override-deps doesn’t seem to do anything. Is it supposed to?


@arohner :override-deps only works inside an alias