This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-16
Channels
- # babashka (17)
- # calva (35)
- # clerk (31)
- # cljs-dev (3)
- # clojars (1)
- # clojure (16)
- # clojure-europe (4)
- # clojurescript (38)
- # clojutre (2)
- # cursive (8)
- # datomic (16)
- # exercism (5)
- # fulcro (5)
- # gratitude (3)
- # hyperfiddle (55)
- # joyride (1)
- # lsp (40)
- # off-topic (6)
- # portal (64)
- # practicalli (1)
- # reitit (3)
- # releases (1)
- # shadow-cljs (38)
- # sql (1)
- # tools-deps (8)
- # xtdb (9)
Not sure where best to post this but it's tools.deps
-adjacent...
In Clojure 1.12.0 Alpha 2, https://clojure.github.io/clojure/branch-master/clojure.tools.deps.interop-api.html#clojure.tools.deps.interop/invoke-tool provides a way to invoke tools in a subprocess. It lets you specify either a tool name (as a string "mytool"
, for -Tmytool
) or as a single alias (as a keyword :mytoolalias
, for -T:mytoolalias
) -- but I have a situation where I have a tool that is essentially spread across two aliases: it has a "swappable" portion that needs to be provided by one of two other aliases. Specifically, it's a tool that expects an HTTP client to be provided in order to run, and using the CLI, you can do that as follows:
> clojure -T:the-tool:http-client-a do-some/stuff
# or:
> clojure -T:the-tool:http-client-b do-some/stuff
It would be really nice to be able to do this programmatically via the new invoke-tool
function (in build.clj
in my case).
Now, invoke-tool
doesn't currently check the type of either the :tool-alias
or the :tool-name
parameter, nor does it currently do anything different based on which one is supplied (except that :tool-alias
is preferred: (str "-T" (or tool-alias tool-name))
), so I could pass :tool-alias ":dev:+default"
in this case and it would "just work" but that seems like a hack...
...would a :tool-aliases
option be a useful addition here (a vector of keywords that was str/join
'd to make the string passed to -T
)?Hi folks, I've been looking at using the http://javamoney.github.io/ APIs. All of the tutorials/examples that I can find (e.g. https://www.baeldung.com/java-money-and-currency) require the use of the org.javamoney/moneta dependency. As far as I can tell this is just a reference to a pom.xml file, rather than a jar. When I add org.javamoney/moneta {:mvn/version "1.4.2"}
to deps.edn and run clojure -Sforce
I get the following error
> Error building classpath. Could not find artifact org.javamoney:moneta:jar:1.4.2 in central (https://repo1.maven.org/maven2/)
Is there a way to use this dependency in deps.edn?
You will need to specify the component subprojects from that pom.xml
explicitly for deps.edn
Aha, cool. Thanks 🙇 . So there's no way to reference those non-jar dependencies in deps.edn?
Not currently, no. You'll need the following, explcitly:
org.javamoney.moneta/moneta-core {:mvn/version "1.4.2"}
org.javamoney.moneta/moneta-convert {:mvn/version "1.4.2"}
org.javamoney.moneta/moneta-convert-imf {:mvn/version "1.4.2"}
org.javamoney.moneta/moneta-convert-ecb {:mvn/version "1.4.2"}
Awesome, thanks 👍