I found several similar topics, like reading from inner structure etc, however it still does not solve my problem.
Project structure:
whole project -> war, which has:
several jar's connected as dependency in pom.xml;
context.xml in META-INF folder, which I need to read from one of jars.
part of it -> jar, which is dependency in war's pom.xml
I've tried a few solutions like:
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream input = classLoader.getResourceAsStream("META-INF/context.xml");
However I did not expect that to work as I think my jar searches for this resource in its structure, not in war.
I need jar project to read context.xml from war project. So, jar is like inner structure and war is outer. Is that possible to do?