IntelliJ Ultimate无法在Play 2.3(Java)项目测试中找到路由 [英] IntelliJ Ultimate can't find routes in Play 2.3 (Java) project tests

查看:191
本文介绍了IntelliJ Ultimate无法在Play 2.3(Java)项目测试中找到路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然我的测试运行得很好,IntelliJ抱怨它无法找到路由对象,但代码自动完成无法正常工作。我查看了整个文档,这应该可行。这是IntelliJ报告的内容

While my tests run just fine, IntelliJ complains that it can't find the routes object and code auto complete fails to work. I've looked all over the documentation and this should just work. Here is what IntelliJ is reporting

关于我的项目配置可能出现什么问题的想法?

Any thoughts as to what might be wrong with my project configuration?

推荐答案

很可能与项目编译期间生成 routes 对象的事实有关。编译后,它应放在 target / scala- {ver} / src_managed 目录下。将此目录标记为源,IntelliJ应正确查看路由。

Most likely it's connected with the fact that the routes object is generated during project compilation. After compilation, it should be placed under the target/scala-{ver}/src_managed directory. Mark this directory as source and IntelliJ should see routes correctly.

您可以使用以下步骤之一来执行此操作:

You can use one of the following steps to do it:


  • 右键单击项目视图中的目录,然后选择将目录标记为 - >生成的源根

  • right-click the directory in the Project view and select Mark Directory As -> Generated Sources Root


  • 打开文件 - >项目结构...... - >模块 - >来源并使用项目结构上方的按钮将 src_managed 目录标记为来源

  • open File -> Project Structure... -> Modules -> Sources and mark the src_managed directory as Sources using the button above the project structure

这篇关于IntelliJ Ultimate无法在Play 2.3(Java)项目测试中找到路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆