Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA doesn't load Lift libraries from a SBT project

I've created a blank project via sbt using the most basic guide, specifically:

> cd xyz
> sbt # here we create a new project w/ Scala 2.8.1
> *lift is org.lifty lifty 1.6.1
> lift create project-blank

however when I open the project in IntelliJ, it doesn't correctly recognize .jars downloaded via sbt. All imports are red

red imports

and when I go to project settings (Ctrl + Alt + Shift + S) in Libraries section, they are all greyed out.

greyed out libraries

Apart from that, the project sources are correctly recognized as Scala project with a Web facet

project structure

Did I forget to configure something? I've already tried to create a project via maven using this guide, but I'd very much prefer to use SBT instead of maven.

like image 728
Jakub Arnold Avatar asked Oct 09 '11 11:10

Jakub Arnold


People also ask

How do I import libraries into IntelliJ?

From the main menu, select File | Project Structure | Project Settings | Modules. Select the module for which you want to add a library and click Dependencies. button and select Library. In the dialog that opens, select a project or a global library that you want to add to the module.

How do I run an SBT Assembly in IntelliJ?

IntelliJ now allows you to create a run configuration for an SBT task. You create the Run Configuration by : choosing "Edit configurations" from the "Run" menu (or the toolbar popup) click the "+" button to add a configuration and select "SBT Task" as the type of configuration you want to make.

How do I get SBT tab in IntelliJ?

Click sbt on the right sidebar to open the tool window. The tool window displays the sbt linked projects, their tasks, dependencies, and all changes made to the underlying build.


1 Answers

Use sbt-idea to create the IntelliJ project structure. Re-run this each time you change the project structure or the library dependencies in your SBT build definition.

Instructions: SBT 0.10.x 0.11.x, SBT 0.7.x

like image 174
retronym Avatar answered Sep 27 '22 20:09

retronym