title: get the root directory of a maven application
body: <p>I need to provide a settings file for my program, to which the user should have access to write some of the settings i need.<br>
  I created a file under a new directory (called settings) on the root of my application, but i have problem finding it at run time.<br>
  I use<br>
  <code>File SettingsFile=new File(ClassLoader.getSystemClassLoader().getResource(".").getPath()+"settings/CreateSettings.txt");</code><br>
  When i execute this under eclipse i get<br>
  <code>/application/home/dir/target/classes/settings/ZipCreateSettings.txt</code> which is wrong.  </p>
  
  <p>If i execute it on terminal using java -jar, i get the correct path,<br>
  <code>/application/home/dir/settings/ZipCreateSettings.txt</code> </p>
  
  <p>This would cause me problems cos i need to run the application directly from eclipse and not use the terminal, even though it is going to be executed using the jar when it is up and running.<br>
  I cant keep it like that anyway, cos this code might end up in someone else's hands, and they would have no idea what to do with it.</p>
  
  <p>I have also used some other techniques like
  <code>new java.io.File("").getAbsolutePath();</code> but this always gives me the current working directory, so if i execute the jar from /home, i would get /home.</p>
  
  <p>I think the problem might be maven (which i am not familiar with at all) since my code worked with a plain java application some time ago.</p>