Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add lib dir to IntelliJ for unmanaged sbt dependencies

sbt allows manually copying in jars to lib/ - it will find and use these unmanaged dependencies. IntelliJ, though, can't seem to find anything I put it that dir. How can I tell it to use them?

like image 766
SRobertJames Avatar asked Jul 06 '14 20:07

SRobertJames


People also ask

Where are dependencies downloaded in SBT?

All new SBT versions (after 0.7. x ) by default put the downloaded JARS into the . ivy2 directory in your home directory. If you are using Linux, this is usually /home/<username>/.

How do I import an existing SBT project into IntelliJ?

After you have an sbt build – one you created yourself or from a template – follow these steps to import the project into IntelliJ IDEA: From the Welcome Screen or File menu, select Open. Browse to and select the top-level folder of your sbt project, and click OK. The Import Project from SBT dialog opens.

Where is plugins SBT in IntelliJ?

IntelliJ plugin can be found here http://confluence.jetbrains.com/display/SCA/Scala+Plugin+for+IntelliJ+IDEA or can be installed directoly from within the IDE using Settings -> Plugins dialog. Afterwards one can just do File -> New Project -> Scala -> SBT based.


3 Answers

You have to add these manually:

  1. Menu File - Project structure
  2. Left side: Select "Modules"
  3. Right side: Select "Dependencies tab"
  4. Click "+"
  5. Choose "Jars or directories"
like image 116
Beryllium Avatar answered Oct 19 '22 15:10

Beryllium


After adding the jars to the lib directory , add this line in build.sbt

exportJars := true

like image 39
Apoorv Shrivastava Avatar answered Oct 19 '22 15:10

Apoorv Shrivastava


Create a lib directory directly under your project directory and place your jar (or symbolic link to jar) there. Note, if you're executing sbt from command prompt, you'll need to be in the project directory for this to work.

like image 37
Bojana Parman Avatar answered Oct 19 '22 13:10

Bojana Parman