4

Basically, I want to have something like the following structure:

├── ...
├── core-module
│   ├── build.gradle
│   └── src
│       ├── main
│       |   └── java
│       |   └── resources
│       |       └── application.properties
│       |       ├── application-dev.properties
│       |       ├── application-test.properties 
│       |       └── application-prod.properties
│       └── test
│           └── java
├── dogs-module
│   ├── build.gradle
│   └── src
│       ├── main
│       |   └── java
│       |   └── resources
│       |       └── application.properties
│       |       ├── application-dev.properties
│       |       ├── application-test.properties 
│       |       └── application-prod.properties
│       └── test
│           └── java
├── cats-module
│   ├── build.gradle
│   └── src
│       ├── main
│       |   └── java
│       |   └── resources
│       |       └── application.properties
│       |       ├── application-dev.properties
│       |       ├── application-test.properties 
│       |       └── application-prod.properties
│       └── test
│           └── java
├── birds-module
│   ├── build.gradle
│   └── src
│       ├── main
│       |   └── java
│       |   └── resources
│       |       └── application.properties
│       |       ├── application-dev.properties
│       |       ├── application-test.properties 
│       |       └── application-prod.properties
│       └── test
│           └── java
├── src?
└── ...
  • dogs, cats and birds modules have the core (or base/common) module as a dependency. For Gradle, it's compile project(':core').
  • dogs, cats and birds modules are not related in any way. The only common feature is the core project.

I am planning the default root src directory to be empty but I could use application.properties, application-{profile}.properties here for some initialization too, if possible.

├── ...
└── src
    └── main
        ├── java
        └── resources
            └── application.properties
            ├── application-dev.properties
            ├── application-test.properties 
            └── application-prod.properties

How can I load properties this way for an environment profile so that properties in the next file could override properties from the previous one?

For instance, coredogs:

  • root-application.properties
  • root-application-prod.properties
  • core-application.properties
  • core-application-prod.properties
  • dogs-application.properties
  • dogs-application-prod.properties
lisymcaydnlb
  • 150
  • 2
  • 12
  • I'm facing the same issue. Did you find a solution? – blubb Nov 23 '19 at 19:46
  • @blubb, not really. The time I had for this task expired, and I made a workaround solution by copying some files and some content here and there. So, this question is kind of still open. – lisymcaydnlb Nov 25 '19 at 16:58

0 Answers0