在遵循Heroku clojure PostgreSQL教程时:https://devcenter.heroku.com/articles/clojure-web-application
该应用可以正确部署和构建,但是运行时会崩溃,并显示错误消息:
2018-10-10T22:18:36.774956+00:00 app[web.1]: Error: Unable to access jarfile target/bitjack-standalone.jar
我的Pocfile是
web: java $JVM_OPTS -jar target/bitjack-standalone.jar
我的project.clj是
(defproject bitjack "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"]
[org.clojure/java.jdbc "0.6.1"]
[org.postgresql/postgresql "9.4-1201-jdbc41"]
[ring/ring-jetty-adapter "1.4.0"]
[compojure "1.4.0"]
[ring/ring-defaults "0.1.2"]
[hiccup "1.0.5"]]
:main ^:skip-aot bitjack.web
:uberjar-name "bitjack-standalone.jar"
:plugins [[lein-ring "0.8.13"]]
:ring {:handler shouter.web//application
:init shouter.models.migrations/migrated}
:profiles {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring-mock "0.1.5"]]}
:uberjar {:aot :all}})
在本地构建和运行完全相同的文件即可。
谢谢您的帮助。