IntelliJ unable to launch Play2 app in module using built-in Play2 runner, but SBT task run-config does work

Hi, I've been playing around with the EAP and tried to run an sample Play2+ScalaJS project generated from this project:, using this command (and no other modifications to the project):

sbt new vmunier/play-scalajs.g8

Then, when I try to create a Play2 runner for the "server" module, it runs the following boot command:

.../sbt-launch.jar xsbt.boot.Boot "project server" run 

[warn] No sbt.version set in project/, base directory: /path/to/play-scalajs/server
[info] Set current project to server (in build file:/path/to/play-scalajs/server/)
[error] java.lang.RuntimeException: No main class detected.
[error] at scala.sys.package$.error(package.scala:27)
[error] (Compile / bgRun) No main class detected.
[error] Total time: 1 s, completed

Ok, so looks it is booting to the "server" module, but I believe-- for this project at least-- that it needs to boot using the root project and then *run* the "server" project.  For example, the following *does* work from IntelliJ:

Create an SBT Task run config and in the "Tasks" field, enter:


Then the boot command looks something like this:

../sbt-launch.jar" xsbt.boot.Boot server/run

And the application runs perfectly!  So seems like it may problem with how IntelliJ is choosing to run a Play2 module when it is not the root project.

Please sign in to leave a comment.