java -jar yourJarFile.jar --spring.config.location=file:/path/to/your/config/file/application.properties
String filePath = System.getProperty("user.dir") + "/config.properties";
HashMap<String, Object> map = new HashMap<>();
Properties properties = new Properties();
properties.load(Main.class.getClassLoader().getResourceAsStream("config.properties"));
if(new File(filePath).exists()) {
properties.load(new FileReader(filePath));
}