I am creating a Spring Boot application and i faced this problem.
I have my application.properties
in recource folder but i also need external.properties file outside of jar to configure properties such like:
name,
password,
etc.
I want to have external.properties file outside of jar and inside resources folder for testing while developing.
I tried creating configuration file like this:
@Configuration
@PropertySource("classpath:" + SpringConfiguration.EXTERNALIZED_PROPERTIES)
@PropertySource(value = "file:./" +
SpringConfiguration.EXTERNALIZED_PROPERTIES, ignoreResourceNotFound = true)
public class SpringConfiguration {
static final String EXTERNALIZED_PROPERTIES = "external.properties";
}
But it still reads properties from resource folder. How can i make it read from outside of jar?