Fork me on GitHub
Jacob Emcken21:08:46

Created a ~/.config/clojure/deps.edn file and copied the content from the inside. Running clojure -X:jar :jar MyLib.jar apparently finds the :jar alias because it does not complaining about WARNING: Specified aliases are undeclared: [:jar] anymore 😄 It does however print No function found on command line or in :exec-fn and exit with the error code 1... I don't understand why :thinking_face:


@jacob429 Just used the commands I posted in #tools-deps -- no need to install depstar or set up an alias.

Jacob Emcken21:08:26

This is probably not going to be my last rodeo... might as well get things working


OK, well, you are missing :exec-fn from the alias.


The readme for depstar has:

;; build a jar (library):
  :jar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.278"}}
        :exec-fn hf.depstar/jar
        :exec-args {}}


Also, per Getting Started, make sure your CLI is up-to-date: > Note: you must have at least version of the Clojure CLI installed! Version is the latest stable version as of depstar 2.1.278. See Clojure Tools Releases for details about the functionality in recent CLI releases.

Jacob Emcken21:08:04

clojure --version
Clojure CLI version

Jacob Emcken21:08:16

cat ~/.config/clojure/deps.edn 
 :aliases {
  ;; build an uberjar (application) with AOT compilation by default:
  :uberjar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.278"}}
            :exec-fn hf.depstar/uberjar
            :exec-args {:aot true}}
  ;; build a jar (library):
  :jar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.278"}}
        :exec-fn hf.depstar/jar
        :exec-args {}}

Jacob Emcken21:08:15

As far as I understand I am not missing exec-fn from the alias... :thinking_face:


Hmm, that looks right, and it's typically what I have in projects...


isn't :replace-deps supposed to be :deps now?


They're synonyms.


:deps is actually the old name (and t.d.a's code says it is supposed to be removed but I doubt it will be now that it's been documented for use with tools).


(same as :tag and :git/tag I think... pretty sure the t.d.a code has a similar comment about that)


Does your project have deps.edn with a different :jar alias perhaps?

Jacob Emcken21:08:00

I remember seeing a warning from the CLI tool output telling me that I should use replace-deps over deps when I was playing around with things

Jacob Emcken21:08:33

Nope no :jar alias... it only contains what "beholder" has.

Jacob Emcken21:08:22

I also checked the ~/.clojure/deps.edn file which was empty (and now deleted)

Jacob Emcken21:08:36

still the same error

Jacob Emcken21:08:42

Ahh well I am going to call it for today... I guess for me these new fancy tools still doesn't want to cooperate with me. Maybe some other time. Thanks @seancorfield