Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ 14 - Create / Import a Scala / SBT project

IntelliJ 14 supports (in theory) SBT / Scala projects through the Scala plugin, which is still available in the official repo. According to this post "Scala plugin project itself now uses SBT for build and dependency management". However I cannot find any way to create or import a SBT / Scala project with IntelliJ. There is also a lack of documentation explaining more about this new way of configuring the Scala Plugin.

I have the Scala plugin activated in the IntelliJ Ultimate 14.0 (139.224). Any ideas?

like image 359
Pablo R. Mier Avatar asked Nov 05 '14 21:11

Pablo R. Mier


People also ask

How do I create a Scala project in sbt?

Delegate a Scala project build to sbtPress Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Build Tools | sbt. In the sbt projects section, select a project for which you want to configure build actions. In the sbt shell section, select the builds option. Click OK to save the changes.

How do I import a project into Scala?

Make sure you have the scala plugin for intellij. Go file>new>'project from existing source', select your project to import. Go to build. sbt and there should be a prompt to import the packages.

How do I open a Scala project in IntelliJ?

To access this option, select File | Settings | Build, Execution, Deployment | Build Tools. Note that any sbt task can be attached to be run before a run configuration. IntelliJ IDEA also lets you use other build tools such as Gradle or Maven to build your Scala project.


2 Answers

  1. Install scala plugin. Settings -> Plugins -> Scala -> Install
  2. Open directory with sbt build: File -> Open Project -> select directory with build.sbt -> configure settings

That worked for me just a couple of minutes ago. It may be necessary to reset cache and restart: File -> Invalidate Caches / Restart.

like image 176
Eugene Zhulenev Avatar answered Oct 19 '22 12:10

Eugene Zhulenev


I've finally figured out the exact problem. IntelliJ loaded the default settings of the previous version, including the old version of the Scala plugin. The problem was fixed uninstalling the old Scala plugin and following the steps posted by Eugene Zhulenev

like image 7
Pablo R. Mier Avatar answered Oct 19 '22 13:10

Pablo R. Mier