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

时间:2017-03-25 16:24:38

标签: clojure boot-clj

将build.boot文件从旧项目复制到新项目时,我收到以下错误,在Google上找不到任何内容:

  

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

2 个答案:

答案 0 :(得分:9)

答案很简单。我错过了根文件夹中的 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

答案 1 :(得分:7)

您应该只包含[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消失了。