title: Differences between dependencyManagement and dependencies in Maven
body: <p>What is the difference between <code>dependencyManagement</code> and <code>dependencies</code>?
  I have seen the docs at Apache Maven web site.
  It seems that a dependency defined under the <code>dependencyManagement</code> can be used in its child modules without specifying the version. </p>
  
  <p>For example:</p>
  
  <p>A parent project (Pro-par) defines a dependency under the <code>dependencyManagement</code>:</p>
  
  <pre><code>&lt;dependencyManagement&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8&lt;/version&gt;
      &lt;/dependency&gt;
   &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  </code></pre>
  
  <p>Then in the child of Pro-par, I can use the junit:</p>
  
  <pre><code>  &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;/dependency&gt;
   &lt;/dependencies&gt;
  </code></pre>
  
  <p>However, I wonder if it is necessary to define junit in the parent pom? Why not define it directly in the needed module?</p>