title: How to avoid banned dependency error in maven?
body: <p>I cannot build my project due to following error:</p>
  
  <pre><code>[WARNING] Rule 6: org.apache.maven.plugins.enforcer.EnforceBytecodeVersion failed with message:
  Found Banned Dependency: de.lmu.ifi.dbs.utilities:common-extension-lib:jar:2.4.0
  Found Banned Dependency: de.lmu.ifi.dbs.jfeaturelib:JFeatureLib:jar:1.6.1
  Use 'mvn dependency:tree' to locate the source of the banned dependencies.
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ----------------
  Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce-rules) on project : 
  Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
  </code></pre>
  
  <p>I tried to use <code>mvn install -Denforcer.skip=true</code> but it did not work as well </p>
  
  <blockquote>
    <p>Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin</p>
  </blockquote>
  
  <p>UPDATE:</p>
  
  <p>I also tried to override the enforcer plugin as follows but still the error remains the same:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-enforcer-plugin&lt;/artifactId&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;enforce-banned-dependencies&lt;/id&gt;
              &lt;goals&gt;
                  &lt;goal&gt;enforce&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;rules&gt;
                      &lt;bannedDependencies&gt;
                          &lt;includes&gt;
                              &lt;include&gt;de.lmu.ifi.dbs.utilities:common-extension-lib&lt;/include&gt;
                              &lt;include&gt;de.lmu.ifi.dbs.jfeaturelib:JFeatureLib&lt;/include&gt;
                          &lt;/includes&gt;
                      &lt;/bannedDependencies&gt;
                  &lt;/rules&gt;
                  &lt;enforceBytecodeVersion&gt;
                      &lt;maxJdkVersion&gt;1.6&lt;/maxJdkVersion&gt;
                      &lt;excludes&gt;
                          &lt;exclude&gt;de.lmu.ifi.dbs.jfeaturelib:JFeatureLib&lt;/exclude&gt;
                          &lt;exclude&gt;de.lmu.ifi.dbs.utilities:common-extension-lib&lt;/exclude&gt;
                      &lt;/excludes&gt;
                  &lt;/enforceBytecodeVersion&gt;
  
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>