Okay. I think I am understanding the problem a little bit. My application copies the resources files to ROOT/appresources/ directory, where I can see both the files in the same structure I mentioned before. But to find from where the config directory is getting loaded, I wrote something like this
println(s"[FILE IS ] ${getClass.getResource("/config").getFile}")
and the result I got was something like
file:<user home>/.ivy2/cache/<package name>/<module name>_2.11/jars/<module name>-<version>-SNAPSHOT.jar!/config
It means that, it is trying to read from the jar file only. But the com.foo.bar.MyClassName$.json files doesn't come from that jar and the class in which I am trying to read the com.foo.bar.MyClassName$.json is in the jar shown above only.
So, my question boils down to How I can read the file from the ROOT/appresources/ directory, when the actual class which reads reside in a jar file?