问题
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