title: reading from a file with Maven
body: <p>I am trying to build a very little program with MAVEN that reads from a file but I obviosly do something wrong because it gives me FileNotFoundException.</p>
  
  <p>This is how my directory structure looks like:</p>
  
  <pre><code>my-app
        src
           main|
               |
               |--java|
               |      |
               |      Main.java
               |
               |--resources|
                           |
                           res.txt
  </code></pre>
  
  <p>The res.txt contains some Strings that I'd like to read from Main.java </p>
  
  <pre><code>...
  File file = new File("res.txt");
  FileReader fr= new FileReader(file);
  BufferedReader br = new BufferedReader( fr);
  ...
  </code></pre>
  
  <p>I compile it with : 
  C:\my-app  mvn package</p>
  
  <p>It creates the jar under target. When I peep inside the jar, I see it contains both Main.class and res.text <em>next to each other</em>.(under the same directory)</p>
  
  <p>Still, when I try to run it :<br>
  java -cp target/my-app-1.0-SNAPSHOT.jar Main</p>
  
  <p>I gives my FileNotFoundException, Main.class somehow does not see res.txt file. Why? Where should I put res.txt? What else should I configure?</p>
  
  <p>Any help would be greatly appriciated.</p>