Separate main and test modules in sbt (beta)
There is a new, experimental mode of working with sbt projects in IntelliJ IDEA with the Scala plugin. If enabled, it organizes main and test sources into separate modules, which improves compilation and dependency management.
Press CtrlAlt0S to open settings and then select Build, Execution, Deployment | Build Tools | sbt.
Enable the Create separate modules for main and test sources option.
Click OK. The project will be reloaded automatically, and new modules will be created.
After the reload, each run configuration referencing a module should switch to the corresponding main or test module. In rare cases, changing the modules in the run configurations may not be possible automatically.
If this happens, you can update the run configurations by explicitly using the Update Run Configurations to a new module naming scheme action. You can find it using Find Action CtrlShift0A or by navigating to Tools | Scala in the main menu.
Refer to the New Module Layout for sbt Projects article in the JetBrains blog for more details and examples of how this new mode helps configure sbt projects.
Thanks for your feedback!