title: Why sometimes it is seen that Java package name is different from folder structure?
body: <p>When I use Eclipse in Java development, it seems you can never make package name and folder structure different. </p>
  
  <p>For example, if you create folder structure <code>src/com/naishe/test</code> and create class under it, the package name will be <code>com.naishe.test</code>, see:</p>
  
  <p><a href="https://stackoverflow.com/questions/9510932/java-package-vs-folder-structure-what-is-the-difference">Java Package Vs Folder-Structure? what is the difference</a></p>
  
  <p>However, i've seen a project example (maven test) where their class path is:</p>
  
  <pre><code>src/test/java/uk/co/automatictester/jwebfwk/page/objects/MainPage.java
  </code></pre>
  
  <p>and package definition is:</p>
  
  <pre><code>package uk.co.automatictester.jwebfwk.page.objects;
  
  public class MainPage extends ParentPage {
   ...
  }
  </code></pre>
  
  <p>the preceding <code>test/java</code> is not in the package name.</p>
  
  <p>How is it done (in Eclipse)?</p>