How to force IntelliJ IDEA to reload dependencies from build.sbt after they changed?

ScalaIntellij IdeaSbt

Scala Problem Overview


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?

Scala Solutions


Solution 1 - Scala

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.

Solution 2 - Scala

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

Solution 3 - Scala

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

Solution 4 - Scala

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.

Solution 5 - Scala

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

Solution 6 - Scala

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDavid B.View Question on Stackoverflow
Solution 1 - ScalaAlefasView Answer on Stackoverflow
Solution 2 - Scalamary janeView Answer on Stackoverflow
Solution 3 - ScalaDavid RiccitelliView Answer on Stackoverflow
Solution 4 - ScalaJeffrey AguileraView Answer on Stackoverflow
Solution 5 - ScalaRajeevView Answer on Stackoverflow
Solution 6 - ScalaHartmut PfarrView Answer on Stackoverflow