I have a spring boot JAR MyMain.jar, which has dependent jars inside BOOT-INF/lib.
I am trying to access a property file inside the BOOT-INF/lib/MyDep.jar/abcd.properties.
I tried the below code.
InputStream in = new ClassPathResource("abcd.properties").getInputStream();
System.out.println("InputStream : "+in);
String line;
BufferedReader br = new BufferedReader(new InputStreamReader(in));
while ((line = br.readLine()) != null) {
System.out.println(line);
}
This works perfect inside my Eclipse IDE. but when I run it on command line as jar it doesn't print anything.
org.springframework.boot.loader.jar.ZipInflaterInputStream@214c265e
readLine() gives null during command line run.
Could anyone please help !