问题描述
根据我在 这个问题在这里.
它工作正常,只是我似乎无法在更新时让 SBT 重新编译我的 Git 依赖项.换句话说:如果我更新依赖项,推送到 Git 并重新加载我项目的 SBT 并运行 package
,那么 SBT 在编译我的项目时不会重新编译外部 Git 依赖项.
It works fine except that I can't seem to get SBT to re-compile my Git dependency when it gets updated. In other words: if I make an update to the dependency, push to Git and reload my project's SBT and run package
, then SBT does not recompile the external Git dependency when compiling my project.
我已经尝试在我的 Git 依赖项中创建一个新分支(例如,forcenew
)并更新我的 SBT 项目配置中的分支以使用它:
I've tried creating a new branch in my Git dependency (say, forcenew
) and updating the branch in my SBT project configuration to use this:
lazy val depProject = RootProject(uri("git://github.com/me/dep-project.git#forcenew"))
但即使这样也不会强制刷新.我有点困惑 - 我什至找不到 SBT 将 Git 项目放在何处来编译它(它似乎不在 ~/.sbt/
或 ~/.ivy2/
)...
But even this doesn't force a refresh. I'm a bit stumped - I can't even find where SBT puts the Git project to compile it (it doesn't seem to be in ~/.sbt/
or ~/.ivy2/
)...
非常感谢任何帮助!
推荐答案
它在 0.12.0 中修复了所以 sbt update
就足够了,但在 13.0 中又回来了 -- 目前,您必须手动从 ~/.sbt/staging/
中清除依赖
It was fixed in 0.12.0 so sbt update
is enough, but got back in 13.0 -- for now, you have to wipe dependency from ~/.sbt/staging/
manually
这篇关于如何在 SBT 中刷新更新的 Git 依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!