activator new play-scala-intro play-scala-intro
File
Import project from Existing sources
SBT
This is the default project structure:
I also tried all the tips from here (recommended for Play 2.2 - 2.3, whereas I have Play 2.4). But I did not try to add target/scala-*/classes_managedto the sources, because my project does not contain this folder.
target/scala-*/classes_managed
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.1")
scalaVersion := "2.11.6"
JetBrains Scala/Play, Play 2.4 (, ). , , .
. https://youtrack.jetbrains.com/issue/SCL-8812. : " EAP IntelliJ Scala 1.6.27.1.EAP, IntelliJ EAP 15 ".
IntelliJ 15. , IntelliJ 14 .
IntelliJ IDEA - 14.1.4, @ controllers :
@
controllers
GET / @controllers.Application.index
IDE Cannot resolve ....
Cannot resolve ...
. 2.4 . https://www.playframework.com/documentation/2.4.x/ScalaRouting , -
, - , - . , "" " ", build.sbt, , :routesGenerator: = InjectedRoutesGenerator
, - , - . , "" " ", build.sbt, , :
routesGenerator: = InjectedRoutesGenerator
, build.sbt, -
routesGenerator := InjectedRoutesGenerator
, - , .
Therefore, to avoid errors, you will need to add @ to the controllers in the routes file, as indicated here https://www.playframework.com/documentation/2.4.x/ScalaRouting -
The code samples in the Plays documentation assume that you are using a route generator. If you do not use this, you can trivially adapt the code samples for the static route generator either by prefixing the part of the route controller call with the @ symbol, or by declaring each of your controllers as an object, not a class.