Clojure China

lein run启动clojure web后不返回shell的疑问

clojure
#1

刚刚接触clojure,试了一下用lein构建简单的web应用,发现:

  1. 使用lein run,或者是lein ring server来启动项目成功后却不返回到shell;
  2. 使用lein uberjar打包后直接通过java -jar来启动同样不返回shell;
  3. 使用java -server -cp `lein classpath` clojure.core -m web.core启动也是如此。
    想知道在生产环境中怎么部署,像daemon一样。
;;project.clj的内容
(defproject web "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 "1.4.0"]
                 [compojure "1.5.0"]
                 [http-kit "2.1.19"]]
  :main web.core)

运行截图:

#2

最好贴一下project.clj文件与执行截图,便于了解问题。

#3

已经加上了

#4

问题不在配置,可能在http-kit。http-kit不输出log info,至于为什么暂时不清楚。你可以自己加log或者切换ring-jetty-adapter测试下。可以参考下:https://jamie.curle.io/posts/simple-app-with-logging/。