0
我的项目中的一个库文件添加了对scala-continuations
的依赖关系。由于这只用于我不使用的库的功能,我想要删除依赖项。这可以通过使用来完成:删除对Scala库的过渡依赖关系
libraryDependencies += "com.jsuereth" %% "scala-arm" % "1.4" exclude(
"org.scala-lang.plugins", "scala-continuations-library_2.11"
)
这工作,但我不喜欢_2.11
部分。我可以用
excludeAll(ExclusionRule(organization="org.scala-lang.plugins"))
目前正与该组织名称不存在其他文物,但它闻起来给我,因为这可能在未来改变。
我可以使用字符串操作从scalaVersion
组成名称:
libraryDependencies += "com.jsuereth" %% "scala-arm" % "1.4" exclude(
"org.scala-lang.plugins", "scala-continuations-library_" + scalaVersion.value.split('.').dropRight(1).mkString(".")
)
有可能还有一些更短的方式做到这一点 - 有些SBT功能或者是通配符操作中排除,或者至少确定斯卡拉版本后缀需要?