This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-22
Channels
- # aws (5)
- # bangalore-clj (3)
- # beginners (84)
- # boot (31)
- # carry (1)
- # cider (6)
- # cljsrn (7)
- # clojure (188)
- # clojure-conj (1)
- # clojure-dev (3)
- # clojure-dusseldorf (8)
- # clojure-greece (10)
- # clojure-italy (7)
- # clojure-nl (3)
- # clojure-russia (45)
- # clojure-spec (5)
- # clojure-uk (64)
- # clojurescript (83)
- # clr (9)
- # core-async (45)
- # cursive (55)
- # datomic (8)
- # devops (1)
- # emacs (7)
- # graphql (1)
- # hoplon (3)
- # jobs (1)
- # jobs-discuss (37)
- # lein-figwheel (3)
- # leiningen (4)
- # luminus (6)
- # off-topic (5)
- # om (2)
- # onyx (33)
- # pedestal (13)
- # re-frame (9)
- # reagent (28)
- # rum (15)
- # specter (4)
- # unrepl (38)
- # vim (3)
boot -h web
java.lang.Thread.run Thread.java: 745
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142
java.util.concurrent.FutureTask.run FutureTask.java: 266
...
clojure.core/binding-conveyor-fn/fn core.clj: 2020
boot.core/boot/fn core.clj: 1029
boot.core/run-tasks core.clj: 1019
boot.task.built-in/fn/fn/fn/fn built_in.clj: 724
java.lang.AssertionError: Assert failed: serve function must be namespaced symbol (null)
(and (symbol? serve) (namespace serve))
clojure.lang.ExceptionInfo: Assert failed: serve function must be namespaced symbol (null)
(and (symbol? serve) (namespace serve))
file: "/tmp/boot.user7576663537556959187.clj"
line: 15
Is there an idiomatic way to silence the following warning when using boot-cljs?
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
@mudphone I don't remember if boot-cljs should be using loggers, but https://github.com/Deraen/less4clj#log-configuration
@juhoteperi thank you. I remember seeing something about that on a different page (using nop w/ test scope). But, I couldn’t remember where.
@qqq When checking task documentation, you should have the -h/--help
after task name: boot web -h
@mudphone yes you can use slf4j-nop-VERSION
in your deps to mute it usually
@U0C8489U6 thanks!
I'm trying to build a standalone jar that includes multiple entry points. For example, I'd like to be able to call java -cp my-app-0.1.0-SNAPSHOT-standalone.jar my_app.server
and java -cp my-app-0.1.0-SNAPSHOT-standalone.jar my_app.background_worker
What's the boot way of accomplishing this? Any pointers to established references also appreciated.
@grzm i believe there can only be one entrypoint in a jar file that is executed via java -jar
from manpage java(1):
By default, the first argument that is not an option of the java
command is the fully qualified name of the class to be called. If the
-jar option is specified, its argument is the name of the JAR file
containing class and resource files for the application. The startup
class must be indicated by the Main-Class manifest header in its source
code.
@micha I believe you're right when calling via -jar
. This is a different pattern. The equivalent in leiningen is described here: https://www.reddit.com/r/Clojure/comments/501zhw/how_do_i_facilitate_multiple_mains_in_an_uberjar/
Ah! I see that the :namespace
option in the jar part of task-options
is a set. That makes sense. I was getting distracted by the :main portion of jar
. I'm still in the early stages of learning boot. Thanks! I'll give that a try.
Right now I'm using a stock template I think I generated using boot-new
. The pipeline in the build task is aot pom uber jar target
, so yeah, something like that 🙂
It's been working okay (for some values of okay). I haven't been as deliberate in my learning on this particular project, so there are some bugs (related to logging at this point) that I need to work out. But that's a separate issue.
Right. That's what I'm going to try. And as I understand it, the :main
for jar
is the single entrypoint for calling via java -jar
On a related note, what's the pattern for creating multiple targets/artifacts? I'd like to keep my code in a monorepo for now. I've seen reference to multiple builds for cljs (https://github.com/martinklepsch/boot-cljs-multiple-builds) but I haven't come across documentation or examples for creating multiple jars.