Jason Zaugg edited this page Apr 4, 2017 · 14 revisions

Integrates Intellij IDEA with Simple Build Tool (SBT) to build Scala projects easily and quickly.

DEPRECATION

JetBrains have recently added support for an SBT console to the IntellIJ Scala Plugin. This is now the recommended way to use SBT within IntellIJ. No new releases of this plugin are planned.

The plugin works with the 0.7 - 0.13 series of SBT.

It is recommended to use this in combination with sbt-idea to synchronize the IDEA module structure with the SBT build.

Basic Settings

Configure VM Parameters under Settings -> SBT. (This is only visible after you load a project.) Starting with version 1.4.0 of the plugin, you are not required to specify the path of sbt-launch.jar, as the plugin ships with the 0.13.0 launcher, which is backwards compatible with all previous SBT versions. For repeatable builds, it is strongly recommended to explicitly specify the desired version of SBT in each of your SBT projects by adding sbt.version=0.13.0 to ./project/build.properties.

Interactive SBT Console

You can use SBT interactively, including running watched command like ~compile. Currently there is only limited completion (CTRL-SPACE will complete compile, test:compile, and a few other options). Console history is available with the up and down arrows.

Run Configuration Settings

You can replace the built in Make from IntelliJ with SBT by adding a "Before Launch" action to Run Configurations. It is useful to do this for the Default Run Configuration for Application, ScalaTest, and Specs2.

For example, here we set the default Specs2 Run Configuration to build with SBT. (The SBT command products runs compile and copy-resources which is typically what you want to use a a pre-run step.

Notification of Build Failure

The SBT Console will pop up showing hyperlinked errors if the compile fails during a "Before Launch" build.

After clicking following one of the links, use CTRL-ALT-UP/DOWN to scroll through the list of errors.

Run in Current Module

If this option is selected, the build is run in the active module for the Run Configuration. This can avoid needless recompilation modules unrelated to the class that you are running.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.