This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-11
Channels
- # announcements (4)
- # aws (6)
- # babashka (40)
- # beginners (318)
- # biff (4)
- # bootstrapped-cljs (9)
- # calva (19)
- # chlorine-clover (1)
- # cider (3)
- # clj-on-windows (25)
- # cljdoc (8)
- # cljfx (1)
- # cljs-dev (30)
- # cljss (2)
- # clojure (62)
- # clojure-chile (9)
- # clojure-europe (11)
- # clojure-finland (17)
- # clojure-italy (1)
- # clojure-kc (1)
- # clojure-nl (3)
- # clojure-spec (27)
- # clojure-uk (40)
- # clojuremn (1)
- # clojurescript (51)
- # conjure (6)
- # cursive (8)
- # data-science (9)
- # datahike (4)
- # datascript (1)
- # datomic (31)
- # emacs (10)
- # emotion-cljs (1)
- # events (1)
- # figwheel-main (16)
- # find-my-lib (1)
- # fulcro (30)
- # graalvm (3)
- # graphql (12)
- # helix (16)
- # honeysql (5)
- # jobs (1)
- # jobs-discuss (10)
- # juxt (3)
- # kaocha (26)
- # lambdaisland (3)
- # leiningen (15)
- # malli (7)
- # off-topic (100)
- # pathom (8)
- # pedestal (15)
- # protojure (24)
- # re-frame (2)
- # reagent (7)
- # reitit (22)
- # remote-jobs (1)
- # shadow-cljs (140)
- # spacemacs (17)
- # spire (2)
- # tools-deps (23)
- # uix (11)
- # vim (5)
- # xtdb (3)
- # yada (3)
I am looking for something like a maven api that I can call from a Clojure app to make a .jar
from a java file + it’s main class name.
I’ve never used maven directly (at least not in anger). Any opinions here?
For context: I am making a .jar and uploading it to a lambda-like service.
Not about tool deps so I hope this is OK - seems like the place where I am most likely to get answers 🙂
Please reply in the thread
@U0ALP2929 What service are you using? I created an AWS lambda-specific output for pack and would be interested in targetting others.
it’s actually pulsar Functions http://pulsar.apache.org/docs/en/functions-overview/
So hence lambda-like, it’s not exactly the same. However they accept a
--jar target/my-jar-with-dependencies.jar \
--classname org.example.functions.WordCountFunction \
OK, looks like you need an uberjar of some kind in that case. I would recommend the library @U04V70XH6 maintains for that.
There's downsides to uberjars (which is why pack doesn't produce them), I'm curious to know if they accept anything else, so I'm reading the docs now :)
is this the lib? https://github.com/seancorfield/depstar
Doesn't look positive for alternative forms. Unfortunate. Depstar is what I'd recommend :)
depstar looks like it is supposed to be used from the CLI, and not sure it supports .java
files?
I am looking for something to embed. I could always shell it / reach into the namespaces though
well the api looks simple enough https://github.com/seancorfield/depstar/blob/master/src/hf/depstar/jar.clj#L9
@U0ALP2929 To build uberjars with depstar
, you should be able to depend on the library and call hf.depstar.uberjar/run
with the appropriate options -- see how the -main
function sets those up. It assumes there's a pom.xml
file available because it uses the presence of that to trigger some of the AOT and manifest generation stuff. It assumes, at a minimum, you've run clojure -Spom
in a project, but you could probably generate a stub pom.xml
as a temp file and pass that in.
And depstar
works from the classpath -- so it will build a JAR from whatever is on your classpath which is very likely not what you're looking for 🙂
jar
is the "official Java tool for making a jar" but it's basically just zip 🙂
Ahah I see 🙂 not what I am looking for indeed. Shelling to javac
or even mvn
looks like it could be the way then
I found this http://maven.apache.org/ref/3.1.0/maven-embedder/index.html but I fear it may be a can of worms 😄