title: Maven is not using dependency version specified in pom.xml
body: <p>I have a project A, which has B and C dependencies.
  The project B also depends on C.</p>
  
  <p>In project A pom, I have:</p>
  
  <pre><code>    &lt;dependencyManagement&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;br.com.mygroup&lt;/groupId&gt;
              &lt;artifactId&gt;C&lt;/artifactId&gt;
              &lt;version&gt;2&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencyManagement&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;br.com.mygroup&lt;/groupId&gt;
              &lt;artifactId&gt;B&lt;/artifactId&gt;
              &lt;version&gt;BVERSION&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;br.com.mygroup&lt;/groupId&gt;
              &lt;artifactId&gt;C&lt;/artifactId&gt;
              &lt;version&gt;2&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;dependencies&gt;
  </code></pre>
  
  <p>In project B(version <code>BVERSION</code>), I have:</p>
  
  <pre><code>    &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;br.com.mygroup&lt;/groupId&gt;
              &lt;artifactId&gt;C&lt;/artifactId&gt;
              &lt;version&gt;1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>I have added some methods in C dependency in version 2, but the code doesn't compile when I try to use the new methods. That is, I can't access the new methods. Project A is using version 1(which is inside project B) of C.</p>
  
  <p>If I change the order of the import in project A pom from <code>B, C</code> to <code>C, B</code>, the code compiles, but at execution time a get <code>java.lang.NoSuchMethodError</code> error.</p>
  
  <p>Shouldn't maven <code>dependencyManagement</code> deal with this problem and force project A to use version 2 of C? Does anyone have an idea of what  I am getting wrong?</p>
  
  <p>EDIT 1:</p>
  
  <p><code>mvn dependency:tree</code> returns the following:</p>
  
  <pre><code>[INFO] br.com.mygroup:A:1.0-SNAPSHOT
  [INFO] +- br.com.mygroup:B:jar:BVERSION:compile
  [INFO] +- br.com.mygroup:C:jar:2:compile
  </code></pre>
  
  <p>EDIT 2:</p>
  
  <p><code>mvn dependency:list</code> returns the following:</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO] 
  [INFO] --------------------&lt; br.com.mygroup:A &gt;---------------------
  [INFO] Building A 1.0-SNAPSHOT
  [INFO] --------------------------------[ war ]---------------------------------
  [INFO] 
  [INFO] --- maven-dependency-plugin:2.8:list (default-cli) @ A ---
  [INFO] 
  [INFO] The following files have been resolved:
  [INFO]    br.com.mygroup:B:jar:BVERSION:compile
  [INFO]    br.com.mygroup:C:jar:2:compile
  [INFO] 
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 1.639 s
  [INFO] Finished at: 2019-10-04T09:03:37-03:00
  [INFO] ------------------------------------------------------------------------
  </code></pre>