【发布时间】:2017-04-05 10:07:48
【问题描述】:
我有几个依赖于Cats 的库。假设新的 Cats 0.4.0 版本在其 POM 中有错误的 apiURL 值。我不希望我的 API 文档损坏,所以我提供了带有 apiMappings 的 URL 映射:
..
autoAPIMappings := false,
apiMappings ++= (fullClasspath in Compile).value.flatMap(
entry => entry.get(moduleID.key).map(entry -> _)
).collectFirst {
case (entry, module)
if module.organization == "org.typelevel" &&
module.name.startsWith("cats-") =>
entry.data
}.map(_ -> url("https://typelevel.org/cats/api/")).toMap,
apiURL := Some(url("https://travisbrown.github.io/iteratee/api/")),
...
这对于我的 API 文档中指向 Cats 类型的链接非常有效,但这意味着我丢失了标准库和其他依赖项中的类型的链接。但是,如果我将autoAPIMappings 更改为true,我的自定义映射就消失了。
这对我来说没有任何意义——似乎明确定义的映射当然不应该被从依赖项 POM 中自动提取的映射覆盖。
我可以使用autoAPIMappings,但针对特定依赖项覆盖它吗?
【问题讨论】: