在引导 Clojure 中使用本地 Maven 存储库
using local Maven repository in boot Clojure
我想使用本地 Maven 存储库(默认位于 ~/.m2/repository
)来查找由 boot 构建的 Clojure 项目的依赖项。
我很确定依赖项在存储库中:
$ ls ~/.m2/repository/ags799/boot-docker/0.0.0-7-gd5196b9-dirty/
_maven.repositories
boot-docker-0.0.0-7-gd5196b9-dirty.jar
boot-docker-0.0.0-7-gd5196b9-dirty.pom
我很确定我的项目正确地引用了依赖项。这是我的 build.boot
(set-env! :dependencies `[[org.clojure/clojure ~(clojure-version)]
[ags799/boot-docker "0.0.0-7-gd5196b9-dirty.jar"]])
(task-options!
pom {:project 'example
:version "0.0.0"}
aot {:namespace #{'example.core}}
jar {:main 'example.core})
然而,当我 运行 boot repl
,我得到这个:
java.lang.Thread.run Thread.java: 745
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142
org.sonatype.aether.util.concurrency.RunnableErrorForwarder.run RunnableErrorForwarder.java: 60
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run WagonRepositoryConnector.java: 669
org.sonatype.aether.connector.wagon.WagonRepositoryConnector.wrap WagonRepositoryConnector.java: 941
org.sonatype.aether.connector.wagon.WagonRepositoryConnector.wrap WagonRepositoryConnector.java: 947
org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact ags799:boot-docker:jar:0.0.0-7-gd5196b9-dirty.jar in clojars (https://repo.clojars.org/)
artifact: #object[org.sonatype.aether.util.artifact.DefaultArtifact 0xa82 java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 61to java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 114he org.sonatype.aether.util.concurrency.RunnableErrorForwarder.run RunnableErrorForwarder.java: 6rtorg.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run WagonRepositoryConnector.java: 66ul org.sonatype.aether.connector.wagon.WagonRepositoryConnector.wrap WagonRepositoryConnector.java: 94ot org.sonatype.aether.connector.wagon.WagonRepositoryConnector.wrap WagonRepositoryConnector.java: 94:1 org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact ags799:boot-docker:jarlu artifact: #object[org.sonatype.aether.util.artifact.DefaultArtifact 0xa82 java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecirty.jar in clojars (https://repo.clojars.org/)
result: #object[org.sonatype.aether.resolution.DependencyResult 0x5a37d3ed "[org.clojure:clojure:jar:1.8.0 < maven-central (https://repo1.maven.org/maven2, releases+snapshots), null < null]"]
clojure.lang.ExceptionInfo: Could not find artifact ags799:boot-docker:jar:0.0.0-7-gd5196b9-dirty.jar in clojars (https://repo.clojars.org/)
line: 3
我还尝试通过在 set-env!
命令中包含 :local-repo "~/.m2/repository"
来手动设置引导路径到本地 Maven 存储库。这不会改变输出。
我还尝试用显式 $HOME
路径 (/Users/andrew
) 替换此路径中的 ~
。这不会改变输出。
这是我的项目boot.properties
:
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.8.0
BOOT_VERSION=2.7.2
我的项目如何使用本地 Maven 存储库来查找依赖项?非常感谢。
依赖声明,是否应该在末尾包含.jar
?
即不应该是这样吗?
(set-env! :dependencies `[[org.clojure/clojure ~(clojure-version)]
[ags799/boot-docker "0.0.0-7-gd5196b9-dirty"]])
我想使用本地 Maven 存储库(默认位于 ~/.m2/repository
)来查找由 boot 构建的 Clojure 项目的依赖项。
我很确定依赖项在存储库中:
$ ls ~/.m2/repository/ags799/boot-docker/0.0.0-7-gd5196b9-dirty/
_maven.repositories
boot-docker-0.0.0-7-gd5196b9-dirty.jar
boot-docker-0.0.0-7-gd5196b9-dirty.pom
我很确定我的项目正确地引用了依赖项。这是我的 build.boot
(set-env! :dependencies `[[org.clojure/clojure ~(clojure-version)]
[ags799/boot-docker "0.0.0-7-gd5196b9-dirty.jar"]])
(task-options!
pom {:project 'example
:version "0.0.0"}
aot {:namespace #{'example.core}}
jar {:main 'example.core})
然而,当我 运行 boot repl
,我得到这个:
java.lang.Thread.run Thread.java: 745
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142
org.sonatype.aether.util.concurrency.RunnableErrorForwarder.run RunnableErrorForwarder.java: 60
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run WagonRepositoryConnector.java: 669
org.sonatype.aether.connector.wagon.WagonRepositoryConnector.wrap WagonRepositoryConnector.java: 941
org.sonatype.aether.connector.wagon.WagonRepositoryConnector.wrap WagonRepositoryConnector.java: 947
org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact ags799:boot-docker:jar:0.0.0-7-gd5196b9-dirty.jar in clojars (https://repo.clojars.org/)
artifact: #object[org.sonatype.aether.util.artifact.DefaultArtifact 0xa82 java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 61to java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 114he org.sonatype.aether.util.concurrency.RunnableErrorForwarder.run RunnableErrorForwarder.java: 6rtorg.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run WagonRepositoryConnector.java: 66ul org.sonatype.aether.connector.wagon.WagonRepositoryConnector.wrap WagonRepositoryConnector.java: 94ot org.sonatype.aether.connector.wagon.WagonRepositoryConnector.wrap WagonRepositoryConnector.java: 94:1 org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact ags799:boot-docker:jarlu artifact: #object[org.sonatype.aether.util.artifact.DefaultArtifact 0xa82 java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecirty.jar in clojars (https://repo.clojars.org/)
result: #object[org.sonatype.aether.resolution.DependencyResult 0x5a37d3ed "[org.clojure:clojure:jar:1.8.0 < maven-central (https://repo1.maven.org/maven2, releases+snapshots), null < null]"]
clojure.lang.ExceptionInfo: Could not find artifact ags799:boot-docker:jar:0.0.0-7-gd5196b9-dirty.jar in clojars (https://repo.clojars.org/)
line: 3
我还尝试通过在 set-env!
命令中包含 :local-repo "~/.m2/repository"
来手动设置引导路径到本地 Maven 存储库。这不会改变输出。
我还尝试用显式 $HOME
路径 (/Users/andrew
) 替换此路径中的 ~
。这不会改变输出。
这是我的项目boot.properties
:
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.8.0
BOOT_VERSION=2.7.2
我的项目如何使用本地 Maven 存储库来查找依赖项?非常感谢。
依赖声明,是否应该在末尾包含.jar
?
即不应该是这样吗?
(set-env! :dependencies `[[org.clojure/clojure ~(clojure-version)]
[ags799/boot-docker "0.0.0-7-gd5196b9-dirty"]])