[2.0.4-java] Requesting assistance in converting computer-database-jpa sample project to use sub-projects

68 views
Skip to first unread message

Joe Wyrembelski

unread,
Nov 11, 2012, 8:50:34 AM11/11/12
to play-fr...@googlegroups.com
I have attempted to take the computer-database-jpa sample included with Play and create a computer-database-jpa-modularized project to demonstrate module dependencies.  It hasn't worked yet and I could use your help.

What I've done: 
  1. Create empty project (computer-database-jpa-modularized)
  2. Create modules directory within and within the new modules directory create two Java projects: model and web
  3. From within model: 
    1. Remove the contents of the app/controllers directory.
    2. Copy the app/models directory from the sample project into the corresponding place in this new project
    3. Copy the appropriate bits from the test, conf, and project directory
    4. Verify that this sub-project works by executing "play test" and seeing that the model tests work.
  4. From within web:
    1. Clean out the default bits
    2. Copy the "web" bits from the sample project into the corresponding places within this app (routes, controllers, views)
  5. Setup the computer-database-jpa-modularized/project/Build.scala to combine the two modules to make a working app
  6. Fail
Any assistance would be appreciated.


Joe Wyrembelski

unread,
Nov 13, 2012, 7:05:42 AM11/13/12
to play-fr...@googlegroups.com
Don't everyone shout at once...

By way of update to this request: In thinking about the best way to separate this project into modules, it seems to me that to really highlight reusable bits there would be three components: 

1) Model
2) Tags (or fragments included on many pages)
3) The controllers and views. 

Anyone out there able to help?

Julien Tournay

unread,
Nov 14, 2012, 6:11:47 AM11/14/12
to play-fr...@googlegroups.com
Hi,

You should post your Build.scala, and the error you get.

jto.

Monteiro

unread,
Nov 14, 2012, 6:24:13 AM11/14/12
to play-fr...@googlegroups.com
Hi Joe,

There are various ways to divide your project.
You can use a simple approach, like frontend, backend, admin, etc ( http://www.playframework.org/documentation/2.0/SBTSubProjects ).

Watch guardian playframework project to take ideias: https://github.com/guardian/frontend/blob/master/project/Frontend.scala

Note: I'm talking in multi-projects and not modules.

Regards,
Reply all
Reply to author
Forward
0 new messages