title: Maven: test dependencies
body: <p><strong>Problem:</strong> Maven can't find some dependencies inside my tests</p>
  
  <pre><code>import org.hamcrest.core.StringStartsWith; // HIGHLIGHTED AS RED IN INTELLIJ
  </code></pre>
  
  <p>It's imported like this in my pom.xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
      &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
      &lt;artifactId&gt;hamcrest-core&lt;/artifactId&gt;
      &lt;version&gt;1.3&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>I already tried:</p>
  
  <ol>
  <li>mvn test-compile</li>
  <li>Invalidate Intellij caches</li>
  <li>Restart Intellij</li>
  <li>Clear .m2 and rebuild project</li>
  </ol>