I have an @Configuration class. This class, has a @PropertySource.
I want to have one different property to each application.
Example:
@Configuration
@PropertySource("file:${my.properties-file}")
public class Config {
}
I want to configure each property to each application via it context name.
My application server directory structure:
webapps/
my-app-a.war
my-app-b.war
Both (my-app-a.war and my-app-b.war) are the same web application, the difference is that they are deployed twices in different contexts.
For that reason, I need to configure this 2 properties:
my.properties.my-app-a=/source/properties/a.properties
my.properties.my-app-b=/source/properties/b.properties
How can I create a custom property source resolver to inject/consider the application context name to load the properties file?