James, Hi.
Ok, so sounds like this will work in production, but not yet in devel (stacktrace at end of this message)
I built against 2.1 snapshot from @3 days ago as per building from source guide. plugins.sbt looks like:
resolvers ++= Seq(
Resolver.url( "publishTo", new URL("
http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/" ))(Resolver.ivyStylePatterns),
Resolver.file( "Local Repository", file("/home/foo/bar/Play21/repository/local" ))(Resolver.ivyStylePatterns),
"Typesafe repository" at "
http://repo.typesafe.com/typesafe/releases/"
)
addSbtPlugin("play" % "sbt-plugin" % "2.1-SNAPSHOT")
I then followed the multi-project guide, doing something like the following in Build.scala:
lazy val root = PlayProject(appName + "-root", appVersion, rootDeps, path = file("root"), mainLang = SCALA)
lazy val model = PlayProject(appName + "-data", appVersion, dataDeps, path = file("model"), mainLang = SCALA) dependsOn(root)
lazy val main = PlayProject(appName + "-app", appVersion, appDeps, path = file("gate"), mainLang = SCALA) dependsOn(root,model) aggregate(root,model)
So main is the entry point (I don't need root or model to be accessible as Play applications, just some odds & ends like I18N, Form, etc. to serve as a base for main)
It is unclear to me how Play aggregates the projects together, particularly around routes, application.conf and any other conf related file (logback.xml, etc.). I assume the last one standing wins (main in this case)
At any rate, Play Cache is really useful ;-) Was thinking about standing up a VMware ESXi *nix instance to run Redis (using Play Redis plugin) over LAN, but that was not on my direct must-do-now list; it will be if I can't get Play cache working in devel, however.
Keep posted if you have any clue as to how I can workaround the issue.
Thanks
*********************
play.api.UnexpectedException: Unexpected exception [ObjectExistsException: Cache play already exists]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$$anonfun$1.apply(ApplicationProvider.scala:125) ~[play_2.9.2.jar:2.1-SNAPSHOT]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$$anonfun$1.apply(ApplicationProvider.scala:103) ~[play_2.9.2.jar:2.1-SNAPSHOT]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.12.0]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3.apply(ApplicationProvider.scala:103) ~[play_2.9.2.jar:2.1-SNAPSHOT]
at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3.apply(ApplicationProvider.scala:101) ~[play_2.9.2.jar:2.1-SNAPSHOT]
at scala.Either$RightProjection.flatMap(Either.scala:520) ~[scala-library.jar:0.12.0]
Caused by: net.sf.ehcache.ObjectExistsException: Cache play already exists
at net.sf.ehcache.CacheManager.addCache(CacheManager.java:990) ~[ehcache-core-2.5.0.jar:na]
at play.api.cache.EhCachePlugin.x$1(Cache.scala:122) ~[play_2.9.2.jar:2.1-SNAPSHOT]
at play.api.cache.EhCachePlugin.cache(Cache.scala:120) ~[play_2.9.2.jar:2.1-SNAPSHOT]
at play.api.cache.EhCachePlugin.onStart(Cache.scala:138) ~[play_2.9.2.jar:2.1-SNAPSHOT]
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:62) ~[play_2.9.2.jar:2.1-SNAPSHOT]
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:62) ~[play_2.9.2.jar:2.1-SNAPSHOT]
*********************