How to force IntelliJ IDEA to reload dependencies

2019-01-13 03:59发布

I'm using IntelliJ IDEA 13 (Community Edition) with the Scala plugin.

My initial import of an existing Scala project with a build.sbt worked 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-import option.

How can I force IDEA to reload the dependencies from build.sbt?

6条回答
ら.Afraid
2楼-- · 2019-01-13 04:18

You can force SBT to reload changes: Open SBT toolwindow (on the right side of IDE) and press refresh button.

If you use auto-import feature you need to save your file to force auto-refresh.

查看更多
聊天终结者
3楼-- · 2019-01-13 04:19

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).

This is the link to the issue opened on JetBrains developer community web site: http://devnet.jetbrains.com/thread/451395

查看更多
Rolldiameter
4楼-- · 2019-01-13 04:19

Perhaps this working only for some kind of projects, but in my case,

on the Library side, I do in 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.

Not having to refresh all sbt projects is faster for me.

查看更多
ら.Afraid
5楼-- · 2019-01-13 04:28

Ticket for broken plublication of sbt.jetbrains is resolved. Updating scala plugin will fix this issue Ticket : http://devnet.jetbrains.com/thread/451395

查看更多
家丑人穷心不美
6楼-- · 2019-01-13 04:36

This may be due to a broken publication of org.jetbrains:sbt-structure:latest.integration that occurred tonight, about 4 or 5 hours ago. Given that your post is 4 hours old ...

You can see the ivy activity in idea.log (~/Library/Logs/IntelliJIdea13 or ~/Library/Logs/IdeaIC13 on OSX).

[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.

查看更多
我只想做你的唯一
7楼-- · 2019-01-13 04:38

IF plugin gets 'stuck' it helps to invalidate cache (under file menu) and restart intellij.

查看更多
登录 后发表回答