title: how to add and read resource file from jar
body: <p>I have hibernate.cfg.xml and test.txt in the path which i read by java program. Now when i created the jar using maven those files were not present. So i read that i should put in the resources folder , so now my directory structure is </p>
  
  <blockquote>
    <p>scr -> main-> java</p>
  
  <pre><code>        -&gt;resources
  </code></pre>
  </blockquote>
  
  <p>Now i can see the files in the jar but they are not inside resource folder 
  it bascically </p>
  
  <blockquote>
    <p>myjar.jar -> com (source code)</p>
  
  <pre><code>       -&gt; META -INF
         -&gt; hibernate.cfg.xml
         -&gt; test.txt
  </code></pre>
  </blockquote>
  
  <p>I tried accessing using </p>
  
  <p>getClass().getResourceAsStream("test.txt") </p>
  
  <p>but got null..</p>
  
  <p>Let me know what steps are wrong ? </p>