为什么sbt (1.3.5)无法在严格模式下解析相同的依赖关系?
> cat build.sbt
conflictManager := sbt.ConflictManager.strict
libraryDependencies += "io.grpc" % "grpc-all" % "1.26.0"
sbt:test> compile
[error] stack trace is suppressed; run last update for the full output
[error] (update) lmcoursier.internal.shaded.coursier.error.conflict.StrictRule: Rule Strict(Set(ModuleMatcher(*:*)),Set(),false,true,false) not satisfied: lmcoursier.internal.shaded.coursier.params.rule.Strict$EvictedDependencies: Unsatisfied rule Strict(*:*): Found evicted dependencies:
[error]
[error] io.grpc:grpc-api:1.26.0 ([1.26.0] wanted)
[error] └─ io.grpc:grpc-all:1.26.0
[error]
[error] io.grpc:grpc-api:1.26.0 ([1.26.0] wanted)
[error] └─ io.grpc:grpc-auth:1.26.0
[error] └─ io.grpc:grpc-all:1.26.0
[error]
[error] io.grpc:grpc-api:1.26.0 ([1.26.0] wanted)
[error] └─ io.grpc:grpc-core:1.26.0
[error] ├─ io.grpc:grpc-all:1.26.0
[error] ├─ io.grpc:grpc-netty:1.26.0
[error] │ └─ io.grpc:grpc-all:1.26.0
[error] ├─ io.grpc:grpc-okhttp:1.26.0
[error] │ └─ io.grpc:grpc-all:1.26.0
[error] └─ io.grpc:grpc-testing:1.26.0
[error] └─ io.grpc:grpc-all:1.26.0
[error]
[error] io.netty:netty-codec-http2:4.1.42.Final ([4.1.42.Final] wanted)
[error] └─ io.grpc:grpc-netty:1.26.0
[error] └─ io.grpc:grpc-all:1.26.0
[error]
[error] io.grpc:grpc-core:1.26.0 ([1.26.0] wanted)
[error] └─ io.grpc:grpc-all:1.26.0
[error]
[error] io.grpc:grpc-core:1.26.0 ([1.26.0] wanted)
[error] └─ io.grpc:grpc-netty:1.26.0
[error] └─ io.grpc:grpc-all:1.26.0
[error]
[error] io.grpc:grpc-core:1.26.0 ([1.26.0] wanted)
[error] └─ io.grpc:grpc-okhttp:1.26.0
[error] └─ io.grpc:grpc-all:1.26.0
[error]
[error] io.grpc:grpc-core:1.26.0 ([1.26.0] wanted)
[error] └─ io.grpc:grpc-testing:1.26.0
[error] └─ io.grpc:grpc-all:1.26.0
[error] Total time: 0 s, completed 19.12.2019 13:38:43
预期版本和实际版本相同。然而,显式版本覆盖是有效的,但是解决所有可传递的依赖关系是很烦人的。
是sbt还是coursier bug?
发布于 2019-12-26 12:45:25
是sbt还是coursier bug?
我不是百分之百确定,但我认为这是需要在Coursier中修复的东西。
关于grpc,一件有趣的事情乍一看可能并不明显,那就是它使用版本范围[1.26.0]
而不是1.26.0
来声明它的依赖关系。可以通过查看他们的POM file来确认这一点。
Coursier (或者将relaxedForAllModules
设置为协调策略的阴影lm-coursier )似乎可以正确地将例如grpc-api
解析为1.26.0
,但可以看看show updateFull
...
[info] io.grpc:grpc-api
[info] - 1.26.0
[info] evicted: false
[info] homepage: https://github.com/grpc/grpc-java
[info] configurations: test, optional, compile, default, runtime
[info] callers: io.grpc:grpc-protobuf-lite:1.26.0, io.grpc:grpc-protobuf:1.26.0, io.grpc:grpc-stub:1.26.0, io.grpc:grpc-all:1.26.0, io.grpc:grpc-core:1.26.0, io.grpc:grpc-auth:1.26.0
[info] - [1.26.0]
[info] evicted: true
[info] evictedData: version selection
[info] homepage: https://github.com/grpc/grpc-java
[info] configurations: test, optional, compile, default, runtime
[info] callers: io.grpc:grpc-all:1.26.0
[info] - [1.26.0]
[info] evicted: true
[info] evictedData: version selection
[info] homepage: https://github.com/grpc/grpc-java
[info] configurations: test, optional, compile, default, runtime
[info] callers: io.grpc:grpc-auth:1.26.0
[info] - [1.26.0]
[info] evicted: true
[info] evictedData: version selection
[info] homepage: https://github.com/grpc/grpc-java
[info] configurations: test, optional, compile, default, runtime
[info] callers: io.grpc:grpc-core:1.26.0
...
它错误地将[1.26.0]
报告为已被1.26.0
逐出的版本。对于不同的调用者,它还会包含三次相同的内容。
由于sbt会根据更新报告生成驱逐报告,因此如果此问题得到解决,我认为驱逐报告将会自行修复。
https://stackoverflow.com/questions/59423185
复制相似问题