I'm using Play Framework 2.2.1 and have a project named "management" with one subproject named "security" (I used the tutorial located here ). Here's my project structure:
management
+ app
+ controllers
+ models
+ views
+ conf
+ application.conf
+ modules
+ security
+ app
+ controllers
+ models
+ views
+ test
+ models
+ ModelsTest.java
build.sbt
+ test
+ models
+ ModelsTest.java
build.sbt
When I run the test command, Play returned me with this error: javax.persistence.PersistenceException: The default EbeanServer has not been defined? This is normally set via the ebean.datasource.default property. Otherwise it should be registered programatically via registerServer()
If I add the application.conf file inside the security/conf directory, it works. How can I do to make the sub-project works with the root application.conf file?
In your management/modules/security/build.sbt
, add the line:
unmanagedResourceDirectories in Test += baseDirectory.value / ".." / ".." / "conf"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With