title: Eclipse: "declared package does not match the expected package", but buildpath does define the declared package
body: <p>In a maven project called <code>my-project</code>, eclipse keeps telling me </p>
  
  <p><strong>The declared package "com.myself" does not match the expected package "main.java.com.myself"</strong></p>
  
  <p>although I verified that in the project's build path, I have an entry:</p>
  
  <pre><code>my-project/src/main/java
      Included: **/*.java
      Excluded: (None)
      Native library location: (None)
      Ignore optional compile problems: No
  </code></pre>
  
  <p><strong>What could be the problem then?</strong></p>
  
  <p><strong>What is the easiest way to fix the problem?</strong></p>
  
  <p>I suspect that something is wrong with the eclipse settings files, because after importing the project to the workspace and converting it to a maven project, I had to change the folder structure manually in to get the conventional folder structure of a maven web project. But it could be that during those changes, something was not understood properly by eclipse.</p>
  
  <p>Also, maven is able to build my project (from within eclipse, as well as from the command line).</p>
  
  <p>I'm just getting those compilation error from eclipse.</p>
  
  <p>P.S. I've already tried project > clean, but it did not help.</p>