This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-07
Channels
- # adventofcode (202)
- # aleph (8)
- # announcements (13)
- # architecture (1)
- # aws (2)
- # beginners (201)
- # boot (1)
- # bristol-clojurians (1)
- # calva (2)
- # cider (23)
- # cljs-dev (22)
- # cljsrn (2)
- # clojure (105)
- # clojure-bangladesh (1)
- # clojure-berlin (8)
- # clojure-dev (104)
- # clojure-europe (3)
- # clojure-italy (5)
- # clojure-losangeles (1)
- # clojure-nl (24)
- # clojure-russia (55)
- # clojure-spec (44)
- # clojure-uk (19)
- # clojurescript (58)
- # component (58)
- # cursive (3)
- # data-science (1)
- # datomic (27)
- # duct (6)
- # events (6)
- # figwheel-main (6)
- # fulcro (15)
- # jobs (3)
- # kaocha (5)
- # luminus (1)
- # music (1)
- # nrepl (2)
- # off-topic (24)
- # onyx (1)
- # pedestal (3)
- # protorepl (8)
- # re-frame (18)
- # reagent (39)
- # reitit (1)
- # remote-jobs (1)
- # ring (15)
- # rum (11)
- # shadow-cljs (5)
- # sql (8)
- # tools-deps (12)
- # vim (7)
I found something odd or don't understand something... a repl started via lein repl in an untouched app created with 'lein new app <appname>' and which includes the following dependencies auto-starts jetty as a process: (defproject autojetty "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "-1.8.0"] [ring/ring-defaults "0.3.2"] [ring/ring-jetty-adapter "1.7.1"]] :main ^:skip-aot autojetty.core :target-path "target/%s" :profiles {:uberjar {:aot :all}})
What's in autojetty.core
?
(ns autojetty.core (:gen-class)) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!"))
There's nothing there that should start Jetty. Perhaps you have some sort of plugin starting it? How do you know Jetty has started?
I couldn't figure out why a jetty process was starting with every start of the app I am working on, so I started removing things one by one and ended up with those two deps and nothing else. I then created a new project, included them, and got the result.
so, to reproduce: lein new app autojetty add [ring/ring-defaults "0.3.2"] and [ring/ring-jetty-adapter "1.7.1"] to the dependencies in project.clj, and then run 'lein repl'; ps aux | grep jetty will show a new process; quitting the repl will stop that process.
Are you sure that's not just the Java process that is running the REPL itself?
I do not see Jetty starting up with your code as-is.
ok, stand by.
I can't replicate it either. There is a process with "jetty" in the command, but that's because the dependency is on the classpath setup by Leiningen.
ps aux | fgrep jetty
shows me the Java processes that Leiningen starts -- as expected, because your project has autojetty
in the name.
I suspect that's it. I'm pretty embarrassed.
(and the classpath for that process also includes a JAR with jetty
in the name)
It's an easy mistake to make if you're not familiar with Leiningen and Java classpaths.
thank you for your understanding (and time!).