Question

I am new to both sbt and play! and want some advice on how to structure this project.

I want to have my models and slick related code outside of my play application.

I know play has sub-modules, but that seems to be play related modules not just a separate module for my models+slick.

  1. How can have my models + slick outside of my play project? Should I just create a separate maven project and import the library via sbt maven local repository?

  2. If I do #1, will that mean if I update my models or slick code I won't be able to simply refresh the browser and get that nice fast re-compile feature?

I will need to re-use my models + slick/dao code in other projects so that I why I don't want it baked into this project.

What options do I have?

Was it helpful?

Solution 2

My solution was to create a multi-sbt module application.

I know have modules for:

/services
/common
/playapp

With this layout I can make changes in any of my modules and I do get the fast compile times with sbt. In the context of a play application, I can simply refresh my browser and my changes are reflected within 3-4 seconds.

If you want details on my project layout, see: Confused how to setup a multi project sbt project

OTHER TIPS

I think the only option you have is to use the sub-modules feature. With this you get a fast recompile cycle and get your project well structured.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top