类路径冲突:org.clojure/clojure 版本 1.7.0 已加载,未加载版本 1.8.0
Classpath conflict: org.clojure/clojure version 1.7.0 already loaded, NOT loading version 1.8.0
将 build.boot 文件从旧项目复制到新项目时出现以下错误,并且在 Google 上找不到任何内容:
Classpath conflict: org.clojure/clojure version 1.7.0 already loaded, NOT loading version 1.8.0
好吧,答案很简单。我在根文件夹中丢失了 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
你应该只包含 [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"]
dependency,启动抱怨。所以,为了摆脱这种依赖,我所做的就是在 build.boot
中进行排除,如下所示:
[pandeiro/boot-http "0.8.3" :exclusions [org.clojure/clojure]]
所以 pandeiro/boot-http
不再依赖于旧的 clojure 版本并且启动组件消失了。
将 build.boot 文件从旧项目复制到新项目时出现以下错误,并且在 Google 上找不到任何内容:
Classpath conflict: org.clojure/clojure version 1.7.0 already loaded, NOT loading version 1.8.0
好吧,答案很简单。我在根文件夹中丢失了 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
你应该只包含 [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"]
dependency,启动抱怨。所以,为了摆脱这种依赖,我所做的就是在 build.boot
中进行排除,如下所示:
[pandeiro/boot-http "0.8.3" :exclusions [org.clojure/clojure]]
所以 pandeiro/boot-http
不再依赖于旧的 clojure 版本并且启动组件消失了。