IntelliJ Ultimate can't find routes in Play 2.3 (Java) project tests

前端 未结 2 1318
被撕碎了的回忆
被撕碎了的回忆 2021-01-14 13:01

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

相关标签:
2条回答
  • 2021-01-14 13:19

    Actually your question motivated me to find solution for this annoying issue :)

    And actually it was already answered, see this answer which works: https://stackoverflow.com/a/21879374/1066240

    Also read other answers and comments.

    0 讨论(0)
  • 2021-01-14 13:31

    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

    or

    • open File -> Project Structure... -> Modules -> Sources and mark the src_managed directory as Sources using the button above the project structure
    0 讨论(0)
提交回复
热议问题