Fork me on GitHub
#tools-deps
<
2024-01-27
>
John Doe06:01:35

When I trying to run a tools alias as below, I notice cli is trying to fetch a load of dependencies from central, may I know where are those things come from? A quick grep from github suggests those may come from tools.deps.alpha? But I thought that repo is deprecated 2 years ago. Why are those things being fetched as the cmd go?

{:aliases :build {:extra-paths ["build"]
          :extra-deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}}
          :ns-default build}}
Downloading: org/clojure/tools.cli/1.0.214/tools.cli-1.0.214.pom from central
Downloading: com/cognitect/aws/api/0.8.612/api-0.8.612.pom from central
Downloading: com/google/guava/guava/31.1-android/guava-31.1-android.pom from central
Downloading: org/apache/maven/maven-core/3.8.6/maven-core-3.8.6.pom from central
Downloading: commons-io/commons-io/2.11.0/commons-io-2.11.0.pom from central
Downloading: com/cognitect/aws/endpoints/1.1.12.321/endpoints-1.1.12.321.pom from central
Downloading: javax/inject/javax.inject/1/javax.inject-1.pom from central
Downloading: org/clojure/java.classpath/1.0.0/java.classpath-1.0.0.pom from central
Downloading: org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.pom from central
Downloading: org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.pom from central
Downloading: com/cognitect/aws/s3/822.2.1145.0/s3-822.2.1145.0.pom from central
Downloading: org/apache/commons/commons-parent/52/commons-parent-52.pom from central
Downloading: com/google/guava/guava-parent/31.1-android/guava-parent-31.1-android.pom from central

Alex Miller (Clojure team)06:01:41

Looks like dependencies for tools.build, which includes tools.deps (not alpha)

1
John Doe06:01:35

Indeed it's from tools.build, I thought it comes from somewhere else. Tx!

John Doe08:01:37

I've got a standard clj cmd clj -A:build -X build/uberjar :lib-name mylib , i notice in the clj --help there's init-opts, I'm a bit confused where --report=stderr would fit in that cmd since I'd like to get the detailed report direct in stderr instead of a edn file. I tried --report=stderr in various places, but did not seems to get the right order...

John Doe08:01:32

after several trials, not able to get --report work, but clj -A:build -J-Dclojure.main.report=stderr -X build/uberjar :lib-name mylib this is working...

seancorfield17:01:28

--report is a clojure.main option so it only works with -M and not with -X/`-T` - which is why you need to use -J which is a CLI script option to set the JVM property.

seancorfield17:01:15

I'm curious why you're using -A/`-X` here instead of -T which is what is normally used with tools.build per the documentation?

John Doe00:01:26

That's a long story, I'm experimenting build with nix using clj-nix, which seems having issue revolving deps when -T, thus I tried my luck with alternative -A -X pattern.. That's a clj-nix specific issue, otherwise I'd just use -T as per docs.

seancorfield01:01:09

Ah, probably because the CLI version is too old. What does clojure -version say?