11

将 build.boot 文件从旧项目复制到新项目时,出现以下错误,在 Google 上一无所获:

类路径冲突:org.clojure/clojure 版本 1.7.0 已加载,未加载版本 1.8.0

4

2 回答 2

10

答案很简单。我错过了根文件夹中的boot.properties文件。只需创建一个包含以下内容的文件:

#https://github.com/boot-clj/boot
#Sun Nov 01 16:34:27 CET 2015
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_VERSION=2.7.1
BOOT_CLOJURE_VERSION=1.8.0
于 2017-03-25T16:24:37.597 回答
10

您应该只包含[org.clojure/clojure "1.8.0"]与引导环境变量相同的版本BOOT_CLOJURE_VERSION=1.8.0

进入 build.boot依赖列表。

摆脱这个问题的另一种方法是从列表中的几个依赖项中排除 clojure 依赖项。

boot show -d

将显示您的依赖项列表,

Classpath conflict: org.clojure/clojure version 1.8.0 already loaded, NOT loading version 1.7.0
2018-01-16 15:05:21.023:INFO::main: Logging initialized @6899ms
[adzerk/boot-cljs "2.1.4" :scope "test"]
[adzerk/boot-reload "0.5.2" :scope "test"]
[hiccup "1.0.5"]
[org.clojure/clojurescript "1.9.946"]
├── [com.google.javascript/closure-compiler-unshaded "v20170910"]
│   ├── [args4j "2.33"]
│   ├── [com.google.code.findbugs/jsr305 "3.0.1"]
│   ├── [com.google.code.gson/gson "2.7"]
│   ├── [com.google.errorprone/error_prone_annotations "2.0.18"]
│   ├── [com.google.guava/guava "20.0"]
│   ├── [com.google.javascript/closure-compiler-externs "v20170910"]
│   ├── [com.google.jsinterop/jsinterop-annotations "1.0.0"]
│   └── [com.google.protobuf/protobuf-java "3.0.2"]
├── [org.clojure/google-closure-library "0.0-20170809-b9c14c6b"]
│   └── [org.clojure/google-closure-library-third-party "0.0-20170809-b9c14c6b"]
├── [org.clojure/tools.reader "1.1.0"]
└── [org.mozilla/rhino "1.7R5"]
[org.clojure/data.json "0.2.6"]
[pandeiro/boot-http "0.8.3"]
└── [org.clojure/clojure "1.7.0"]
[ring/ring-core "1.6.3" :exclusions [[org.clojure/clojure]]]
├── [clj-time "0.11.0"]
│   └── [joda-time "2.8.2"]
├── [commons-fileupload "1.3.3"]
├── [commons-io "2.5"]
├── [crypto-equality "1.0.0"]
├── [crypto-random "1.2.0"]
└── [ring/ring-codec "1.0.1"]
    └── [commons-codec "1.6"]
[ring/ring-jetty-adapter "1.6.3" :exclusions [[org.clojure/clojure]]]
├── [org.eclipse.jetty/jetty-server "9.2.21.v20170120"]
│   ├── [javax.servlet/javax.servlet-api "3.1.0"]
│   ├── [org.eclipse.jetty/jetty-http "9.2.21.v20170120"]
│   │   └── [org.eclipse.jetty/jetty-util "9.2.21.v20170120"]
│   └── [org.eclipse.jetty/jetty-io "9.2.21.v20170120"]
└── [ring/ring-servlet "1.6.3"]

如您所见,这里是:

[pandeiro/boot-http "0.8.3"]
└─[org.clojure/clojure "1.7.0"]

依赖项,引导正在抱怨。因此,我为摆脱这种依赖所做的就是在build.boot此处进行排除:

[pandeiro/boot-http "0.8.3" :exclusions [org.clojure/clojure]]

因此pandeiro/boot-http不再依赖于旧的clojure 版本,并且引导compain 消失了。

于 2018-01-16T13:15:17.643 回答