Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share application.conf file between subprojects?

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?

like image 727
segaco Avatar asked Oct 20 '22 13:10

segaco


1 Answers

In your management/modules/security/build.sbt, add the line: unmanagedResourceDirectories in Test += baseDirectory.value / ".." / ".." / "conf"

like image 86
dickmao Avatar answered Oct 23 '22 03:10

dickmao