我需要在sbt build中配置Ivy lock strategy。
我尝试将externalIvySettings(baseDirectory(_ / "ivysettings.xml"))
放入Build.scala
ivysettings.xml:
<ivysettings>
<settings defaultResolver="default"/>
<include url="${ivy.default.settings.dir}/ivysettings-public.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-local.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
<lock-strategies>no-lock</lock-strategies>
</ivysettings>
但在这种情况下,sbt无法解析依赖关系(我想因为解析器会被来自ivysettings的解析器屏蔽掉)。
如何在Build.scala
中配置锁定策略?
答案 0 :(得分:2)
花了一些时间后,我找到了解决方案。我从defaultSettings复制粘贴了ivyConfiguration,并用None替换了GlobalLock参数(我需要禁用锁定):
ivyConfiguration <<= (externalResolvers, ivyPaths, offline, checksums, appConfiguration, target, streams) map { (rs, paths, off, check, app, t, s) =>
val resCacheDir = t / "resolution-cache"
new InlineIvyConfiguration(paths, rs, Nil, Nil, off, None, check, Some(resCacheDir), s.log)
}
对我来说这看起来像是一种解决方法,但它确实有效。现在没有常春藤锁了。 如果你知道怎么做,请帮助我改进解决方案,因为我是sbt。
的新手