我通过在 App Engine 上开发 Clojure工作。然后我尝试使用boot复制相同的功能。但是,我不知道如何在启动项目中包含 Google App Engine(非 Maven)代码。感谢任何帮助我度过这一点的帮助。
以下所有代码都托管在这里
这是当前工作project.clj
(defproject clojure-gae "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.7.0"]
[ring "1.4.0-RC2"]
[compojure "1.3.4"]
[com.google.appengine/appengine-api-1.0-sdk "1.9.31"]]
:plugins [[lein-ring "0.9.6" :exclusions [org.clojure/clojure]]]
:ring {:handler clojure-gae.core/app}
:profiles {:dev
{:dependencies
[[com.google.appengine/appengine-api-stubs "1.9.31"]
[com.google.appengine/appengine-local-runtime "1.9.31"]
[com.google.appengine/appengine-local-runtime-shared "1.9.31"]]}})
这是我正在处理的当前损坏build.boot
的,基于以前的project.clj
.
(set-env!
:source-paths #{"src"}
:resource-paths #{"assets"}
:dependencies '[[compojure "1.3.4"]
[com.google.appengine/appengine-api-stubs "1.9.31"]
[com.google.appengine/appengine-local-runtime "1.9.31"]
[com.google.appengine/appengine-local-runtime-shared "1.9.31"]
[org.clojure/clojure "1.7.0"]
[pandeiro/boot-http "0.7.1-SNAPSHOT" :scope "test"]
[ring "1.4.0-RC2"]])
(require
'[pandeiro.boot-http :refer :all])
(task-options!
pom {:project "clojure-gae"
:version "0.1"}
jar {:main 'clojure_gae.core
:manifest {"Description" "A Clojure Application on Google App Engine"}}
repl {:init-ns 'clojure-gae.core}
serve {:handler 'clojure-gae.core/app
:reload true})
(def DEV_DEPENDENCIES '[])
(deftask dev
"Profile for doing local development"
[]
(set-env! :dependencies #(reduce conj % DEV_DEPENDENCIES))
(comp
(serve)))
它失败了
bash$ boot dev
2016-01-18 21:02:01.826:INFO::clojure-agent-send-off-pool-0: Logging initialized @5139ms
clojure.lang.ExceptionInfo: java.lang.ClassNotFoundException: com.google.appengine.api.datastore.DatastoreServiceFactory, compiling:(clojure_gae/core.clj:1:1)
data: {:file
"/var/folders/f8/brrq5_n902jdb7m3bb8vsvsh0000gn/T/boot.user2792359634710984639.clj",
:line 27}
java.util.concurrent.ExecutionException: java.lang.ClassNotFoundException: com.google.appengine.api.datastore.DatastoreServiceFactory, compiling:(clojure_gae/core.clj:1:1)
clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: com.google.appengine.api.datastore.DatastoreServiceFactory, compiling:(clojure_gae/core.clj:1:1)
java.lang.ClassNotFoundException: com.google.appengine.api.datastore.DatastoreServiceFactory
...
clojure-gae.core/eval1150/loading--auto-- core.clj: 1
clojure-gae.core/eval1150 core.clj: 1
...
clojure.core/load/fn core.clj: 5866
clojure.core/load core.clj: 5865
...
clojure.core/load-one core.clj: 5671
clojure.core/load-lib/fn core.clj: 5711
clojure.core/load-lib core.clj: 5710
...
clojure.core/apply core.clj: 632
clojure.core/load-libs core.clj: 5749
...
clojure.core/apply core.clj: 632
clojure.core/require core.clj: 5832
...
pandeiro.boot-http.util/resolve-sym util.clj: 4
pandeiro.boot-http.impl/ring-handler impl.clj: 66
pandeiro.boot-http.impl/server impl.clj: 102
...
clojure.core/eval core.clj: 3081
boot.pod/eval-in* pod.clj: 369
...
boot.pod/eval-in* pod.clj: 372
pandeiro.boot-http/eval85/fn/fn boot_http.clj: 51
...
clojure.core/deref core.clj: 2206
pandeiro.boot-http/eval85/fn/fn/fn boot_http.clj: 83
boot.core/run-tasks core.clj: 794
boot.core/boot/fn core.clj: 804
clojure.core/binding-conveyor-fn/fn core.clj: 1916
...
显然,boot
不知道如何获取com.google.appengine
代码。在lein
我的世界里,lein localrepo install ...
我经历了一些关于如何将非 Maven 项目安装到我的本地存储库中的步骤(在文章中)。似乎 App Engine Jar 应该仍然在我的本地存储库中,但启动似乎没有看到它们。如何使 appengine jar 在我的引导项目中可见?