首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >sbt严格模式中的奇怪版本冲突

sbt严格模式中的奇怪版本冲突
EN

Stack Overflow用户
提问于 2019-12-20 17:53:11
回答 1查看 258关注 0票数 4

为什么sbt (1.3.5)无法在严格模式下解析相同的依赖关系?

代码语言:javascript
运行
复制
> cat build.sbt
conflictManager := sbt.ConflictManager.strict
libraryDependencies += "io.grpc" % "grpc-all" % "1.26.0"
代码语言:javascript
运行
复制
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?

EN

回答 1

Stack Overflow用户

发布于 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

代码语言:javascript
运行
复制
...
[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会根据更新报告生成驱逐报告,因此如果此问题得到解决,我认为驱逐报告将会自行修复。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59423185

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档