SBT - What actually happens when I click on "Build module"?

I have a multi project SBT project, and I found that running `sbt compile` and `build -> rebuild project` (from IntelliJ) is generating different output :

1. Some resources are not copied to the target directories (For example, I have project "core" that contains resources - those resources are not copied to `target/scala-2.11` directory)

2. IntelliJ doesn't seem to trigger the protobuf generator plugin (ScalaPB). So I need to do it manually before developing anything...

I would love to get some help regarding this issue, It's really bugging me in the last days, I wish that there was some `task` that I could override or create in the sbt file and IntelliJ would run it, without having to set things in other developers computers.

Using : 

IntelliJ IDEA 2016.3
Build #IC-163.7743.44, built on November 17, 2016
JRE: 1.8.0_112-release-408-b2 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

SBT 0.13.13, Scala 2.11.8

Comment actions Permalink

Currently, the IntelliJ build is independent from the sbt build, except that it imports settings from sbt. Additional build steps in sbt will not be respected. We are currently working on better integration of sbt, so that build tasks will be delegated directly to an sbt shell. Meanwhile, I recommend either running an sbt shell in a terminal window for building, or setting up a "SBT Task" run configuration in the IDE for building the project.

Comment actions Permalink

Justin, thanks for the quick answer.

Is there any road map for the better sbt integration?


Comment actions Permalink

The next release version of the Scala plugin will include some level of sbt shell integration. There might be a nightly build of the Scala plugin with some basic support for building in an sbt shell in the next few days.


Please sign in to leave a comment.