Q:

version.properties file could not be found IBM watson bot sdk

I am developing a chat bot using IBM Watson conversation. When I build the project and run, it gives null in inputStream in the RequestUtils.java class in the java-sdk/conversation. but when I run it from the ide it works.
 InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("version.properties");

I noticed that properties file is not inside the jar. How to add this properties file to the jar when it is being built? What could be the possible cause? Any help is appreciated.
Thanks.
P.S:scehema of the classes are as follows
parent
project1
project2
Maven Dependencies
|-conversation-3.5.3.jar
| |-package1
| |-packeage2
| |-META-INF
|-core-3.5.3.jar
  |-package1
  |-packeage2
  |  |-RequestUtils.class
  |-META-INF 
  |-version.properties   

A:

I fixed it by my own.
the thread will inherit its context classloader from its parent Thread. If you don't do anything at all in the entire application, all Threads will end up with the system classloader as their context classloader.
So I set the contextClassLoader on my own for the current thread as follows.
ClassLoader classLoader = MyClass.class.getClassLoader();
Thread.currentThread().setContextClassLoader( classLoader );

now it works fine.

