我想运行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)
....
Run Code Online (Sandbox Code Playgroud)
米尔是如何做到这一点的?
我尝试了mill-console,没有命令(mill resolve _),谷歌也无法提供帮助。
我假设,您正在寻找可能的类路径问题/警告,这是由传递依赖项引入的相同依赖项的不同版本的结果。
\n\n在 mill 中,您可以使用ivyDepsTree目标来显示具有所有传递 ivy 依赖项的树。该树还包含有关版本调整的详细信息。这些线条将以不同的颜色打印。默认情况下,橙色表示微/补丁版本更改,红色表示次要版本更改。
让我们看看以下随机 Java 项目的摘录:
\n\n$ mill __.ivyDepsTree\n...\n[416/426] <redacted>.test.ivyDepsTree\n\xe2\x94\x9c\xe2\x94\x80 com.lihaoyi:mill-contrib-testng:0.5.1-14-ef3708\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 org.scala-sbt:test-interface:1.0\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.testng:testng:6.11 -> 6.14.2 (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 com.beust:jcommander:1.72\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.apache-extras.beanshell:bsh:2.0b6\n\xe2\x94\x9c\xe2\x94\x80 org.testng:testng:6.14.2\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 com.beust:jcommander:1.72\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.apache-extras.beanshell:bsh:2.0b6\n\xe2\x94\x9c\xe2\x94\x80 de.tototec:de.tobiasroeser.lambdatest:0.7.0\n\xe2\x94\x9c\xe2\x94\x80 org.slf4j:slf4j-api:1.7.25\n\xe2\x94\x9c\xe2\x94\x80 ch.qos.logback:logback-classic:1.2.3\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 ch.qos.logback:logback-core:1.2.3\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.slf4j:slf4j-api:1.7.25\n\xe2\x94\x9c\xe2\x94\x80 org.aspectj:aspectjrt:1.8.13\n\xe2\x94\x9c\xe2\x94\x80 org.fedorahosted.tennera:jgettext:0.15\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 antlr:antlr:2.7.7\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.slf4j:slf4j-api:1.7.5 -> 1.7.25\n\xe2\x94\x9c\xe2\x94\x80 org.antlr:com.springsource.antlr:2.7.7\n...\nRun Code Online (Sandbox Code Playgroud)\n\n由于版本冲突,您可以看到一些调整:(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"\n...\n[416/426] <redacted>.test.ivyDepsTree \n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.testng:testng:6.11 -> 6.14.2 (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 org.hibernate:com.springsource.org.hibernate:3.2.6.ga -> 3.3.2.GA (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 org.jboss.javassist:com.springsource.javassist:3.3.0.ga -> 3.9.0.GA (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.testng:testng:6.4 -> 6.14.2 (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.testng:testng:6.4 -> 6.14.2 (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80 org.objenesis:objenesis:1.2 -> 2.6 (possible incompatibility)\nRun Code Online (Sandbox Code Playgroud)\n