public class ApplicationConfigUtil { public ApplicationConfigUtil() { } public static String getConfigByKey(String key) throws IOException { Properties config = new Properties(); String filePath = System.getProperty("user.dir") + File.separator + "src/main/resources/application.yml"; InputStream in = new BufferedInputStream(new FileInputStream(filePath)); config.load(in); return config.getProperty(key); } }
读取jar包外的配置文件
最新推荐文章于 2024-04-02 19:03:23 发布