Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting IntelliJ IDEA understand SBT dependencies

I have SBT and Scala installed and things work well.

Now I have an IntellIJ IDEA project, which works otherwise OK except that dependencies which are downloaded into /Users/MyName/.ivy2/cache/ are not understood.

I tried setting the cache path as a source folder:

enter image description here

but still things don't work out:

enter image description here

As you can see, org.eclipse is in red color meaning it can't find it. It must be inside that .jar file I showed on the left.

I just want to update/download dependencies using SBT, and then get the compilation to work in IntelliJ IDEA with those dependencies.

like image 487
Tower Avatar asked Sep 01 '12 14:09

Tower


1 Answers

Use the sbt-idea plugin for SBT. Then you can run "gen-idea" from the sbt command line and it will generate the metadata files used by IDEA. These files contain the locations of jars as SBT uses them so that IDEA will know where the dependencies are, just like SBT.

like image 176
dhg Avatar answered Oct 13 '22 00:10

dhg