0
我想使用本地Maven倉庫(默認爲~/.m2/repository
)來查找由boot構建的Clojure項目的依賴關係。在啓動時使用本地Maven倉庫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$1.run RunnableErrorForwarder.java: 60
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run WagonRepositoryConnector.java: 669
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap WagonRepositoryConnector.java: 941
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.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$1.run RunnableErrorForwarder.java: 6rtorg.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run WagonRepositoryConnector.java: 66ul org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap WagonRepositoryConnector.java: 94ot org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.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倉庫?非常感謝。
確實,*嘆*。 'local-repository'設置是不必要的。這最終成爲一個非常簡單的問題,我不介意刪除這個問題。 – user1592772
別擔心。你有一個問題,其他人也可能會這樣做,他們可能會發現它有幫助。 – Bill