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
andbirds
modules have thecore
(or base/common) module as a dependency. For Gradle, it'scompile project(':core')
.dogs
,cats
andbirds
modules are not related in any way. The only common feature is thecore
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, core
← dogs
:
- root-application.properties
- root-application-prod.properties
- core-application.properties
- core-application-prod.properties
- dogs-application.properties
- dogs-application-prod.properties