title: maven dependency pulling a wrong dependency
body: <p>I have a dependency as follows:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.2&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>This is pulling down another dependency <code>httpcore.4.1.4</code> which throws a ClassDefNotFound, when i deploy <code>httpcore.4.2</code> everything works.</p>
  
  <p>I added both of the dependencies as follows: </p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.2&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpcore&lt;/artifactId&gt;
          &lt;version&gt;4.2&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>and still facing the same issue ie: mvn brings down <code>httpcore.4.1.2</code> not <code>httpcore.4.2</code></p>
  
  <p>how can i resolve this?</p>
  
  <p>EDIT: </p>
  
  <p>added;</p>
  
  <pre><code>&lt;dependencyManagement&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
              &lt;artifactId&gt;httpcore&lt;/artifactId&gt;
              &lt;version&gt;4.2&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  </code></pre>