I previously asked a question here about how to use SBT with multiple sub project web applications. This worked excellent, now however I am trying to create a sub project that should NOT be a webapp, but which the other web app projects will depend on (common models etc etc). Is there a way to set up this sub project in along with the other web application sub projects OR should I just create a separate project alltogehter that creates a jar and have my webapps have it as a library dependency?
Currently I have the code for the non webapp project in as a subproject and the other sub projects depend on it, i.e.
lazy val admin = Project("admin", file("admin")) dependsOn(common) settings(webappSettings :_*)
// ^^^^ defines the dependency
... other project definitions
lazy val common = Project("common", file("common"))
This works, but when I package the applications I get a common.war
.
I should probably also mention that the common project does contain some web related code that depend on Lift, but I want it to be packaged as a jar and not a war... Oh, and the webapp wars seem to include the actual classes into the generated war from the common project.
So how should I:
- Create a
common
project which contain web related code (will for instance need to run tests that uses jetty), but is compiled into a jar? - Include the
common
project in my web application projects? - Can/should the
common
project be included as a sub project along with my web applications?