From bc0eac0d0ae68b1b7c587490b3490ffbe9e5f4a8 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Fri, 13 Nov 2015 23:27:09 -0800 Subject: [PATCH] For development: look up kobalt.properties locally if not found in the class loader. --- .../main/java/com/beust/kobalt/wrapper/Main.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java index c5af4b39..d5914dec 100644 --- a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java +++ b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java @@ -57,7 +57,18 @@ public class Main { if (url != null) { readProperties(result, url.openConnection().getInputStream()); } else { - throw new IllegalArgumentException("Couldn't find " + KOBALT_PROPERTIES); + File file = new File("src/main/resources/kobalt.properties"); + if (file.exists()) { + FileInputStream fis = null; + try { + fis = new FileInputStream(file); + readProperties(result, fis); + } finally { + if (fis != null) fis.close(); + } + } else { + throw new IllegalArgumentException("Couldn't find " + KOBALT_PROPERTIES); + } } return result; }