如何解决Clojure与Leiningen:如何获得本地依赖关系?
我正在通过 Programming Clojure 本书来学习Clojure,但是在尝试从本书的工作中获取实例方面,我停留了很早。
我从书中下载了代码示例;目录结构是
examples/
其中有一堆.clj文件,其中包括一个名为 introduction.clj 的文件。
我要运行的代码始于
(require 'examples/introduction')
...但是我无法使它正常工作。
我尝试添加一个 checkouts 目录,并在其中将示例目录符号链接。 我尝试用Manifest.txt制作.jar文件,使其版本为1.0.0 ....
但是跑步
lein repl
到目前为止,总是会出现错误,例如
在中央(https://repo1.maven.org/maven2/)中找不到工件示例:介绍:jar:1.0.0 在clojars(https://repo.clojars.org/)中找不到工件示例:introduction:jar:1.0.0 这可能是由于:dependencies,文件系统权限或网络问题引起的错字。
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"]}})
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。