Clojure 与 Leiningen:如何包含本地依赖项?
Clojure with Leiningen: how to get local dependencies included?
我正在努力通过 Programming Clojure 这本书来学习 Clojure,但很早就想从书中找到一个例子。
我下载了书中的代码示例;目录结构是
examples/
里面有一堆 .clj 文件,包括一个叫做 introduction.clj.
我正在尝试 运行 的代码以
开头
(require 'examples/introduction')
...但我无法让它工作。
我试过添加 checkouts 目录并在其中链接示例目录。
我试过制作一个带有 Manifest.txt 版本 1.0.0 ....
的 .jar 文件
但是运行宁
lein repl
到目前为止总是报错,比如
Could not find artifact examples:introduction:jar:1.0.0 in central (https://repo1.maven.org/maven2/)
Could not find artifact examples:introduction:jar:1.0.0 in clojars (https://repo.clojars.org/)
This could be due to a typo in :dependencies, file system permissions, or network issues.
project.clj文件是这样的:
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
[clj-http "2.0.0"]
[examples/introduction "1.0.0"]]
:main ^:skip-aot my-stuff.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})
我错过了什么?非常感谢任何指导!
在 leetwinski 的有用评论之后更新的 project.clj 文件:
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
[clj-http "2.0.0"]]
:source-paths ["/home/mark/src/cloj/code/src/examples"]
:main ^:skip-aot my-stuff.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})
我正在努力通过 Programming Clojure 这本书来学习 Clojure,但很早就想从书中找到一个例子。
我下载了书中的代码示例;目录结构是
examples/
里面有一堆 .clj 文件,包括一个叫做 introduction.clj.
我正在尝试 运行 的代码以
开头(require 'examples/introduction')
...但我无法让它工作。
我试过添加 checkouts 目录并在其中链接示例目录。 我试过制作一个带有 Manifest.txt 版本 1.0.0 ....
的 .jar 文件但是运行宁
lein repl
到目前为止总是报错,比如
Could not find artifact examples:introduction:jar:1.0.0 in central (https://repo1.maven.org/maven2/) Could not find artifact examples:introduction:jar:1.0.0 in clojars (https://repo.clojars.org/) This could be due to a typo in :dependencies, file system permissions, or network issues.
project.clj文件是这样的:
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
[clj-http "2.0.0"]
[examples/introduction "1.0.0"]]
:main ^:skip-aot my-stuff.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})
我错过了什么?非常感谢任何指导!
在 leetwinski 的有用评论之后更新的 project.clj 文件:
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
[clj-http "2.0.0"]]
:source-paths ["/home/mark/src/cloj/code/src/examples"]
:main ^:skip-aot my-stuff.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})