3

我想evicted在我的Mill项目中运行。

使用SBT,它可以在 中完成sbt-console,使用:

sbt>evicted

这将返回版本冲突警告列表:

[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]  * com.typesafe:ssl-config-core_2.13:0.3.8 is selected over 0.4.0
[warn]      +- com.typesafe.play:play-ws-standalone_2.13:2.0.6    (depends on 0.3.8)
[warn]      +- com.typesafe.play:play_2.13:2.7.3 ()               (depends on 0.3.8)
[warn]      +- com.typesafe.akka:akka-stream_2.13:2.5.23 ()       (depends on 0.4.0)
....

Mill 是如何做到这一点的?

我试过了mill-console,没有命令(mill resolve _),谷歌也无能为力。

4

1 回答 1

4

我假设,您正在寻找可能的类路径问题/警告,这是传递依赖关系引入的相同依赖关系的不同版本的结果。

在 Mill 中,您可以使用ivyDepsTree目标来显示具有所有可传递 ivy 依赖项的树。此树还包括有关版本调整的详细信息。这些线条将以不同的颜色打印。默认情况下,橙色表示微/补丁版本更改,红色表示次要版本更改。

让我们看一下随机 Java 项目的以下摘录:

$ mill __.ivyDepsTree
...
[416/426] <redacted>.test.ivyDepsTree
├─ com.lihaoyi:mill-contrib-testng:0.5.1-14-ef3708
│  ├─ org.scala-sbt:test-interface:1.0
│  └─ org.testng:testng:6.11 -> 6.14.2 (possible incompatibility)
│     ├─ com.beust:jcommander:1.72
│     └─ org.apache-extras.beanshell:bsh:2.0b6
├─ org.testng:testng:6.14.2
│  ├─ com.beust:jcommander:1.72
│  └─ org.apache-extras.beanshell:bsh:2.0b6
├─ de.tototec:de.tobiasroeser.lambdatest:0.7.0
├─ org.slf4j:slf4j-api:1.7.25
├─ ch.qos.logback:logback-classic:1.2.3
│  ├─ ch.qos.logback:logback-core:1.2.3
│  └─ org.slf4j:slf4j-api:1.7.25
├─ org.aspectj:aspectjrt:1.8.13
├─ org.fedorahosted.tennera:jgettext:0.15
│  ├─ antlr:antlr:2.7.7
│  └─ org.slf4j:slf4j-api:1.7.5 -> 1.7.25
├─ org.antlr:com.springsource.antlr:2.7.7
...

由于版本冲突,您可以看到一些适应:(org.slf4j:slf4j-api:1.7.5 -> 1.7.25微版本升级)和org.testng:testng:6.11 -> 6.14.2 (possible incompatibility)(小版本升级)。

此外,您可以将输出通过管道传输grep到以过滤输出,例如mill __.ivyDepsTree | grep "incompatibility".

这看起来像一个可用的磨机,相当于sbt evicted.

$ mill __.ivyDepsTree | grep "incompatibility"
...
[416/426] <redacted>.test.ivyDepsTree 
│  └─ org.testng:testng:6.11 -> 6.14.2 (possible incompatibility)
│  ├─ org.hibernate:com.springsource.org.hibernate:3.2.6.ga -> 3.3.2.GA (possible incompatibility)
│  ├─ org.jboss.javassist:com.springsource.javassist:3.3.0.ga -> 3.9.0.GA (possible incompatibility)
│  └─ org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)
│  │     └─ org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)
│  │  │     └─ org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)
│  │  │  └─ org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)
│  │  └─ org.testng:testng:6.4 -> 6.14.2 (possible incompatibility)
│  └─ org.testng:testng:6.4 -> 6.14.2 (possible incompatibility)
│     │     └─ org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)
│        └─ org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)
于 2019-09-25T18:04:22.900 回答