Spring.
src/main/resources/application.properties , . classpath , .
Then with annotation @PropertySourcein other projects that depend on a common module:
@Configuration
@PropertySource("classpath*:META-INF/spring/properties/*.properties")
public class Config {
...
}
Or with the XML configuration:
<context:property-placeholder location="classpath*:META-INF/spring/properties/*.properties"/>
It should import all configuration files into the transfer class directory.
In addition, you should know that you cannot have two identical files in the classpath. You will have a conflict.
For example, this situation will create a conflict :
Project A (depends on project B):
src/main/resources/application.properties
Project B:
src/main/resources/application.properties
You will need to rename the file application.propertiesor put it in another directory.
source
share