0

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?

Cyril N.
  • 38,875
  • 36
  • 142
  • 243

1 Answers1

2

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?

Community
  • 1
  • 1
adis
  • 5,901
  • 7
  • 51
  • 71
  • I have simillar problem with submodules models. Could You help me? It is here: http://stackoverflow.com/questions/25884772/package-names-namespaces-in-subproject-classes-in-play-framework – masterdany88 Sep 17 '14 at 08:00