title: How to declare global dependency for all submodules with maven and eclipse
body: <p>I have multimodule structured maven project as follow:</p>
  
  <ul>
  <li>parent
  
  <ul>
  <li>server</li>
  <li>shared</li>
  <li>client</li>
  </ul></li>
  </ul>
  
  <p>For me it is obvious that I would write unit test for all of those projects. So I thought that will be enought to add dependency to parent's pom.xml as follow:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;junit&lt;/groupId&gt;
      &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;version&gt;4.12&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>and then in each submodule use it, f.e.:</p>
  
  <pre><code>import static org.junit.Assert.assertEquals;
  import static org.junit.Assert.assertFalse;
  import static org.junit.Assert.assertNotNull;
  import static org.junit.Assert.assertTrue;
  </code></pre>
  
  <p>but I am getting errors in Eclipse like: <code>The import org.junit cannot be resolved</code></p>
  
  <p>When I do Maven-> Update project, or <code>mvn clean install</code>, there are no errors at all.</p>
  
  <p>I refer to the parent module in a children one as follow:</p>
  
  <pre><code>&lt;parent&gt;
      &lt;groupId&gt;pl.daniel.erp&lt;/groupId&gt;
      &lt;artifactId&gt;erp&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  </code></pre>
  
  <p>Please help</p>