使用 SBT 重新下载依赖项的 SNAPSHOT 版本
问题描述:
我的 build.sbt
文件中有以下几行.
I have the following lines in my build.sbt
file.
resolvers += "specs2 snapshot repo" at "http://scala-tools.org/repo-snapshots"
libraryDependencies += "org.specs2" %% "specs2" % "1.7-SNAPSHOT" % "test"
现在如果快照发生了变化(这是否合理,maven SNAPSHOT 版本发生变化而其版本号没有变化?),我如何告诉 sbt 下载新版本?使用 update
什么都不做.
Now if the snapshot has changed (is this reasonable at all, that a maven SNAPSHOT version changes without its version number changing?), how can I tell sbt to download the new version? Using update
does nothing.
答
你应该试试:
libraryDependencies += "org.specs2" %% "specs2" % "1.7-SNAPSHOT" % "test" changing()
changed()
将指定依赖项可以改变,并且它必须在每次 update
时下载它.
changing()
will specify that the dependency can change and that it ivy must download it on each update
.
也许您也可以尝试使用 ivyXML
定义您的存储库.像这样:
Maybe you could also try to define your repository using ivyXML
. Something like this :
ivyXML :=
<resolvers>
<ibiblio name="specs2 snapshot repo" changingPattern="*-SNAPSHOT" m2compatible="true" root="http://scala-tools.org/repo-snapshots"/>
</resolvers>
希望这会有所帮助.