apache/maven · warning · IllegalArgumentException

groupId can neither be null, empty nor blank

Error message

groupId can neither be null, empty nor blank

What it means

The POM of a resolved dependency contains <distributionManagement><relocation>, meaning the artifact moved to new coordinates. When the relocated artifact is a direct dependency (dependency trail size 1), Maven logs this warning including the new groupId:artifactId:version plus any relocation message; for transitive dependencies the same text is logged at debug level only.

Source

Thrown at compat/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java:99

    public static String key(String groupId, String artifactId, String version) {
        notBlank(groupId, "groupId can neither be null, empty nor blank");
        notBlank(artifactId, "artifactId can neither be null, empty nor blank");
        notBlank(version, "version can neither be null, empty nor blank");

        return groupId + ":" + artifactId + ":" + version;
    }

    private static void notBlank(String str, String message) {
        final int strLen = str != null ? str.length() : 0;
        if (strLen > 0) {
            for (int i = 0; i < strLen; i++) {
                if (!Character.isWhitespace(str.charAt(i))) {
                    return;
                }
            }
        }
        throw new IllegalArgumentException(message);
    }

    public static Map<String, Artifact> artifactMapByVersionlessId(Collection<Artifact> artifacts) {
        Map<String, Artifact> artifactMap = new LinkedHashMap<>();

        if (artifacts != null) {
            for (Artifact artifact : artifacts) {
                artifactMap.put(versionlessKey(artifact), artifact);
            }
        }

        return artifactMap;
    }

    public static Artifact copyArtifactSafe(Artifact artifact) {
        return (artifact != null) ? copyArtifact(artifact) : null;
    }

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Update the <dependency> coordinates in your POM to the relocated groupId/artifactId shown in the warning
  2. Read the appended relocation message: some relocations are deliberate bridges and need no action
  3. For the transitive (debug-level) variant, manage the new coordinates in <dependencyManagement> and exclude the old ones

Example fix

<!-- before -->
<dependency>
  <groupId>com.oldcorp</groupId>
  <artifactId>billing-client</artifactId>
  <version>2.1.0</version>
</dependency>
<!-- after: relocated coordinates from the warning -->
<dependency>
  <groupId>com.newcorp</groupId>
  <artifactId>billing-client</artifactId>
  <version>2.1.0</version>
</dependency>
Defensive patterns

Strategy: validation

Validate before calling

# detect relocated direct dependencies after a version bump
mvn -q dependency:tree -Dincludes=com.oldcorp:*
# an empty tree means the old coordinates resolved only via relocation; update the POM

Prevention

When it happens

Trigger: A dependency declared directly in the project resolves to a POM whose <relocation> block points at different coordinates; Maven warns so you can update your declaration.

Common situations: javax to jakarta coordinate moves; a company groupId rename after an acquisition; library split-ups where old coordinates stay resolvable only as relocation stubs; the warning appearing right after a version bump.

Related errors


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/176071054c65d1c2. Report an issue: GitHub.