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!).