I cannot build my project due to following error:
[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.
I tried to use mvn install -Denforcer.skip=true
but it did not work as well
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
UPDATE:
I also tried to override the enforcer plugin as follows but still the error remains the same:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<includes>
<include>de.lmu.ifi.dbs.utilities:common-extension-lib</include>
<include>de.lmu.ifi.dbs.jfeaturelib:JFeatureLib</include>
</includes>
</bannedDependencies>
</rules>
<enforceBytecodeVersion>
<maxJdkVersion>1.6</maxJdkVersion>
<excludes>
<exclude>de.lmu.ifi.dbs.jfeaturelib:JFeatureLib</exclude>
<exclude>de.lmu.ifi.dbs.utilities:common-extension-lib</exclude>
</excludes>
</enforceBytecodeVersion>
</configuration>
</execution>
</executions>
</plugin>
This rule checks the dependencies and fails if any of the matching excludes are found. The following parameters are supported by this rule: searchTransitive - if transitive dependencies should be checked.
How to fix require upper bound dependencies error. If that artifact is already declared in pom. xml, update the version in the pom. xml to the newest version listed in the output from maven-enforcer-plugin.
Multiple transitive dependencies can be excluded by using the <exclusion> tag for each of the dependency you want to exclude and placing all these exclusion tags inside the <exclusions> tag in pom. xml. You will need to mention the group id and artifact id of the dependency you wish to exclude in the exclusion tag.
You can modify the configuration of the enforcer plugin. For example:
<configuration>
<rules>
<enforceBytecodeVersion>
<maxJdkVersion>1.5</maxJdkVersion>
<excludes>
<exclude>org.mindrot:jbcrypt</exclude>
</excludes>
</enforceBytecodeVersion>
</rules>
<fail>true</fail>
</configuration>
You could increase the max JDK version.
You could add an exclude for the jars.
You could set fail to false.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With