Play Framework application layout with custom Java package name
It’s not really obvious how you could use custom Java package namespace in play framework 2.4.x. The official doc simply has a one liner:
the controllers, models and views package name conventions are now just that
- do you put the
- What about the
conffolder? also the
- What about sub-projects?
- Say you got it to work with
activatoryou probably still can’t get IntelliJ stop complaining about ‘package name do not corresspond to path’?
So, I came up with a sample Play 2.4.x Java project that has the bare bone components to show how it could be done.
- the correct project folder structure
- config referencing modules from a custom package
- views referencing layouts and partials from a custom package
- views referencing models from a custom package
- views referencing helper from a sub-project library
- routes referencing controllers from a custom package
- build.sbt building solutions and internal library with custom packages