title: Maven java.io.FileNotFoundException
body: <p>I'm developing a project with Maven. In a class to send e-mails, in run and dev modes, I get the following error: Caused by: java.io.FileNotFoundException: jQuery/images/logo.png (Ficheiro ou directoria inexistente) ==> translation = File or directory not found.</p>
  
  <p>I've tryed lots of paths, like "./jQuery/images/logo.png", "/jQuery/images/logo.png" and others. The full relative path is: "src/main/webapp/jQuery/images/logo.png".</p>
  
  <p>In "target" folder, the path is "project-1.0-SNAPSHOT/jQuery/images/logo.png".
  Inside war file, is "jQuery/images/logo.png".</p>
  
  <p>I don't think it's important, but I'm using NetBeans 7.1.1 as IDE.</p>
  
  <p>I found that the absolute path returned in runtime is "/home/user/apache-tomcat-7.0.22/bin/jQuery/images/logo.png"!... It's not the project path!</p>
  
  <p>How can I get a file in webapp folder and descendents from a Java class, in a Maven project?</p>
  
  <p>The code is:</p>
  
  <pre><code>MimeBodyPart attachmentPart = null;
          FileDataSource fileDataSource = null;
          for (File a : attachments) {
              System.out.println(a.getAbsolutePath());
  
              attachmentPart = new MimeBodyPart();
              fileDataSource = new FileDataSource(a) {
  
                  @Override
                  public String getContentType() {
                      return "application/octet-stream";
                  }
              };
              attachmentPart.setDataHandler(new DataHandler(fileDataSource));
              attachmentPart.setFileName(fileDataSource.getName());
  
              multipart.addBodyPart(attachmentPart);
          }
  
          msg.setContent(multipart);
          msg.saveChanges();
  
          Transport transport = session.getTransport("smtp");
          transport.connect(host, from, "password");
          transport.sendMessage(msg, msg.getAllRecipients());
  </code></pre>