An example of Java package namespacing (e.g. com.org) in Play Framework 2.4.x
Java Scala HTML CSS Other
Permalink
Failed to load latest commit information.
app/com/org/web
conf
libraries/com.org.web.common
project
public
test
.gitignore
LICENSE
README.md
activator
activator.bat
build.sbt
clean-compile.sh

README.md

Example of Package namespacing in Play Framework (Java) app

It's not really obvious how you could use the non default package namespace in play framework 2.4.x.

The official doc simply has a one liner:

Note that in Play, the controllers, models and views package name conventions are now just that and can be changed if needed (such as prefixing everything with com.yourcompany).

This solution has the bare bone components to show how it could be done.

It showcases:

  1. the project folder structure
  2. config referencing modules from a custom package
  3. views referencing layouts and partials from a custom package
  4. views referencing models from a custom package
  5. views referencing helper from a sub-project library
  6. routes referencing controllers from a custom package
  7. build.sbt building solutions and internal library with custom packages

Run activator run.