简体   繁体   English

Play Project无法在Intellij中正确编译-route_routing.scala

[英]Play Project not compiling correctly in Intellij - routes_routing.scala

I have a simple Play project with one controller (with a route) and a unittest. 我有一个带有一个控制器(带有一个路由)和一个单元测试的简单Play项目。

When I type "sbt compile test" into terminal it runs fine and the test passes. 当我在终端中输入“ sbt编译测试”时,它运行良好并且测试通过。

I cannot get the solution to compile correctly in IntelliJ however. 我无法获得在IntelliJ中正确编译的解决方案。

Controller: controllers.nisp.LandingPageController 控制器: controllers.nisp.LandingPageController

Compile error: 编译错误:

.../nisp-frontend/target/scala-2.11/src_managed/main/app/routes_routing.scala 
Error:(37, 18) object LandingPageController is not a member of package app.controllers.nisp 
controllers.nisp.LandingPageController.showLandingPage(),
            ^

Directory structure: 目录结构:

在此处输入图片说明

I have solved this issue using the following method: 我已使用以下方法解决了此问题:

  • Upgrade to Intellij 14 升级到Intellij 14
  • Upgrade to the latest scala plugin. 升级到最新的scala插件。
  • Remove the whole project directory and re-cloned the source. 删除整个项目目录,然后重新克隆源代码。
  • Use File -> Import Project -> SBT -> Auto-Import. 使用文件->导入项目-> SBT->自动导入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM