我根据教程https://www.jetbrains.com/help/idea/2016.2/getting-started-with-play-2-x.html(“创建项目”一节)在Intellij IDEA 2016.2.2中创建了一个新的游戏项目。结果我得到了一个包含文件Application.scala
的项目:
package controllers
import play.api._
import play.api.mvc._
class Application extends Controller {
def index = Action {
Ok(views.html.index("Your new application is ready."))
}
}
然后我尝试使用Build
- >构建它Rebuild project
命令。但是我遇到了构建错误:
Error:(9, 19) object index is not a member of package views.html
Ok(views.html.index("Your new application is ready."))
使用Run
- >启动应用后Run 'Play2Run'
并将target
文件夹包含到构建过程中,我设法通过Build
- >构建项目Rebuild project
。但是在我没有通过play
启动应用程序的情况下构建之前我该怎么做?
解释为什么我的问题与其他问题不重复:
我没有在IntelliJ中找到clean project
机会。使IntelliJ的缓存无效也无济于事。此新项目中也没有目录target/scala-2.11/src_managed/main
和target/scala-2.11/twirl/main
。它们在Run 'Play2Run'
之后出现,之后我可以配置这个Java Build Path,但我想避免使用Run 'Play2Run'
。如何在没有Run 'Play2Run'
的情况下创建这些目录?