Exception in thread "main" java.io.FileNotFoundException: when running maven project using java -cp command
<p>I'm facing </p>

<blockquote>
  <p>Exception in thread "main" java.io.FileNotFoundException: sample (No
  such file or directory)</p>
</blockquote>

<p>when i'm trying to execute java program using</p>

<pre><code>java -cp samplee.jar com.x.y.TestProgram 
</code></pre>

<p>I wrote a java program and created a jar using Maven build and input to the program is a file named 'sample' which i kept in project root folder(So i did n't mention the path of file) and com.x.y.TestProgram is the location of my program that has my main method.  </p>

<p>Also i'm reading my file inside my java program using </p>

<pre><code>BufferedReader br = new BufferedReader(new FileReader("sample"));
</code></pre>

<p>I had read couple of posts describing same exception but does n't seem to be related my issue
Need guidance in resolving the issue?</p>