scala 更改后如何强制 IntelliJ IDEA 从 build.sbt 重新加载依赖项?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20413605/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to force IntelliJ IDEA to reload dependencies from build.sbt after they changed?
提问by David B.
I'm using IntelliJ IDEA 13 (Community Edition) with the Scala plugin.
我正在使用 IntelliJ IDEA 13(社区版)和 Scala 插件。
My initial import of an existing Scala project with a build.sbtworked fine. The library dependencies were picked up by IDEA. Additional dependencies added after the initial import were not picked up, although I had checked the auto-importoption.
我对现有 Scala 项目的初始导入build.sbt效果很好。库依赖项由 IDEA 选取。尽管我已经选中了该auto-import选项,但并未选择在初始导入后添加的其他依赖项。
How can I force IDEA to reload the dependencies from build.sbt?
如何强制 IDEA 重新加载依赖项build.sbt?
回答by Alefas
You can force SBT to reload changes: Open SBT toolwindow (on the right side of IDE) and press refresh button.
您可以强制 SBT 重新加载更改:打开 SBT 工具窗口(在 IDE 的右侧)并按刷新按钮。
If you use auto-import feature you need to save your file to force auto-refresh.
如果您使用自动导入功能,您需要保存文件以强制自动刷新。
回答by mary jane
IF plugin gets 'stuck' it helps to invalidate cache (under file menu) and restart intellij.
如果插件被“卡住”,它有助于使缓存无效(在文件菜单下)并重新启动 intellij。
回答by David Riccitelli
As of 7 Dec, 2013, the issue is solved. You need to update the Scala plugin in IntelliJ IDEA(this applies to both community and ultimate editions).
截至 2013 年 12 月 7 日,该问题已解决。您需要更新 IntelliJ IDEA 中的 Scala 插件(这适用于社区版和终极版)。
This is the link to the issue opened on JetBrains developer community web site: http://devnet.jetbrains.com/thread/451395
这是在 JetBrains 开发者社区网站上打开的问题的链接:http: //devnet.jetbrains.com/thread/451395
回答by Jeffrey Aguilera
This may be due to a broken publication of org.jetbrains:sbt-structure:latest.integrationthat occurred tonight, about 4 or 5 hours ago. Given that your post is 4 hours old ...
这可能是由于org.jetbrains:sbt-structure:latest.integration今晚(大约 4 或 5 小时前)发布的内容已损坏。鉴于您的帖子已有 4 小时...
You can see the ivy activity in idea.log(~/Library/Logs/IntelliJIdea13or ~/Library/Logs/IdeaIC13on OSX).
您可以在idea.log(~/Library/Logs/IntelliJIdea13或~/Library/Logs/IdeaIC13OSX 上)看到 ivy 活动。
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.jetbrains#sbt-structure;latest.integration: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] org.jetbrains:sbt-structure:latest.integration (sbtVersion=0.13, scalaVersion=2.10)
I have opened a ticket at JetBrains.
我在 JetBrains 开了一张票。
回答by Rajeev
Ticket for broken plublication of sbt.jetbrains is resolved. Updating scala plugin will fix this issue Ticket : http://devnet.jetbrains.com/thread/451395
已解决 sbt.jetbrains 损坏的故障单。更新 scala 插件将解决此问题票证:http: //devnet.jetbrains.com/thread/451395
回答by Hartmut P.
Perhaps this working only for some kind of projects, but in my case,
也许这仅适用于某种项目,但就我而言,
on the Library side, I do in sbt: publishLocal
在图书馆方面,我这样做sbt:publishLocal
on the Client side where the Library goes into, I click the menu item Build -> Build (Ctrl-F9), and sometimes, when open Files or Intellisens are not yet current, I do Ctrl-Alt-Y(Menu item File -> Synchronize) to get the file reflecting the refreshed code base.
在库进入的客户端,我单击菜单项Build -> Build (Ctrl-F9),有时,当打开的文件或 Intellisens 还不是最新的时,我会执行Ctrl-Alt-Y(菜单项File -> Synchronize)以获取反映刷新后的代码库的文件。
Not having to refresh all sbt projectsis faster for me.
refresh all sbt projects对我来说不必更快。

