java build_error ai_generated true

Failed to execute goal org.codehaus.mojo:license-maven-plugin:2.0.0:check (default) on project my-app: Some dependencies have incompatible licenses. See /path/to/license-summary.html

ID: java/maven-license-check-failure

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2025-09-05First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
8+ active

Root Cause

A dependency's license is not in the allowed list configured in the license-maven-plugin.

generic

中文

依赖的许可证不在 license-maven-plugin 配置的允许列表中。

Workarounds

  1. 90% success Add the license to the allowed list in pom.xml
    <plugin><groupId>org.codehaus.mojo</groupId><artifactId>license-maven-plugin</artifactId><configuration><allowedLicenses><license><name>Apache 2.0</name></license></allowedLicenses></configuration></plugin>
  2. 85% success Exclude the dependency with an incompatible license and find an alternative
    <dependency><groupId>com.example</groupId><artifactId>lib</artifactId><exclusions><exclusion><groupId>problematic-group</groupId><artifactId>problematic-artifact</artifactId></exclusion></exclusions></dependency>

Dead Ends

Common approaches that don't work:

  1. Removing the dependency without checking if it's needed 80% fail

    The code may rely on that dependency, causing compilation errors.

  2. Ignoring the license check by skipping the plugin 70% fail

    The project may have legal requirements to enforce license compliance.