title: Preventing overriding dependency version in Maven child pom
body: <p>I have a dependencyManagement section in parent pom like</p>
  
  <pre><code>&lt;dependencyManagement&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.2.1&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencyManagement&gt;
  </code></pre>
  
  <p>and a child pom, having it</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.0&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>I've tried to prevent this kind of overriding in child poms using <a href="http://maven.apache.org/enforcer/maven-enforcer-plugin/" rel="noreferrer">enforcer plugin</a>, allowing these only to be set in parent, but haven't been able to. I'd like this to fail the build. Is that possible, with that plugin or some other way?</p>
  
  <p>There is <a href="http://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html" rel="noreferrer">DependencyCovergence</a>, which forces all versions to be the same, but that's too restrictive as I don't want to control all transitive dependencies - just the ones defined explicitly.</p>
  
  <p>I'd be happy if I could just prevent introducing any new dependencies at all in child poms - everything defined should really be defined in the parent pom, and then just mentioned, if needed, in the child.</p>