PlayFramework 2.1, submodules and Eclipse having errors about invalid package name

不想你离开。 提交于 2019-12-25 04:17:06

问题


Using PlayFramework 2.1 and submodules, I have an error with all my controllers in Eclipse :

"The declared package "controllers.website" does not match the expected package "controllers"

Of course, because in my module, I added controllers in modules/{submodule_name}/app/controllers/, eg: modules/website/app/controllers/

But as defined in the documentation of Play, controllers must have the package name "controllers.{submodule_name}" ("controllers.website").

And this results in an error in Eclipse for each controllers.

How can I fix that in Eclipse? Is it possible to rename the folder? or tell Eclipse it's okay in that case?


回答1:


I have renamed my controller package too, just rename it, rename it in routes and run the following commands:

play clean and

play compile and

play eclipse

Read more about this topic: Play Framework: How to change play default packages?



来源:https://stackoverflow.com/questions/15520954/playframework-2-1-submodules-and-eclipse-having-errors-about-invalid-package-na

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!