【问题标题】:boot-clj: get rid of "version conflict detected"boot-clj:摆脱“检测到版本冲突”
【发布时间】:2016-10-08 18:27:46
【问题描述】:

boot-clj 在启动时显示很多关于版本冲突的警告:它们看起来像这样:

Warning: version conflict detected: org.clojure/clojure version changes from 1.5.1 to 1.8.0
Warning: version conflict detected: clj-time version changes from 0.8.0 to 0.12.0
Warning: version conflict detected: riddley version changes from 0.1.7 to 0.1.12
Warning: version conflict detected: org.codehaus.plexus/plexus-utils version changes from 2.0.7 to 2.0.6
Warning: version conflict detected: org.clojure/tools.namespace version changes from 0.2.11 to 0.2.10
Warning: version conflict detected: com.fasterxml.jackson.core/jackson-core version changes from 2.1.1 to 2.3.2

我不太明白为什么有时第一个版本低于另一个版本,有时反之亦然。看起来我无法影响他们中的大多数人。例如,在我的项目中,我在版本 0.12.0 中需要 clj-time,所以我猜警告来自一个库,它本身需要另一个版本的 clj-time。

有没有办法修复它们,还是我总是使用-q 标志来“抑制引导本身的输出”?这可能会阻止显示其他可能更重要的输出吗?

【问题讨论】:

  • 您是否尝试使用-d 标志?
  • 您的意思是手动添加缺少的依赖项?

标签: clojure boot-clj


【解决方案1】:

例子:

文件/tmp/stackoverflow/boot.build

(set-env! :dependencies '[[clj-time "0.12.0"]
                          [joda-time "2.9.4"]])

在终端中:

Borkdude@MBP /tmp/stackoverflow $ boot show -d
Warning: version conflict detected: joda-time version changes from 2.9.3 to 2.9.4
Warning: version conflict detected: joda-time version changes from 2.9.3 to 2.9.4
[clj-time "0.12.0"]
└── [org.clojure/clojure "1.8.0"]
[joda-time "2.9.4"]
Borkdude@MBP /tmp/stackoverflow $ boot show -p
Warning: version conflict detected: joda-time version changes from 2.9.3 to 2.9.4
Warning: version conflict detected: joda-time version changes from 2.9.3 to 2.9.4
[✔] joda-time
    ✔ 2.9.4
      joda-time
    ✘ 2.9.3
      clj-time

所以,boot show -d 会告诉你有效的传递依赖树。 boot show -p 将提供有关冲突的更多详细信息。这里它告诉我们对joda-time 的依赖拉入joda-time 2.9.4,但它与clj-time 想要拉入joda-time 2.9.3 冲突。

假设我们不直接依赖joda-time,而是依赖于joda-time 2.9.4 的其他库foo。然后,我们可以通过在clj-time 上使用排除项来消除此警告:[clj-time "0.12.0" :exclusions [joda-time]] 在我们的项目中获得2.9.4 而不会发出警告。

【讨论】:

  • 我还是没听懂。 boot show -d 打印例如cljs-time 在树中只有一次:[clj-time "0.12.0"].. 0.8.0 的警告来自哪里? + 排除是什么意思?
猜你喜欢
  • 2019-06-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-01-13
  • 2020-03-07
  • 2019-10-08
相关资源
最近更新 更多