quarkusio/quarkus · error · IllegalArgumentException

ArtifactId is empty in `${str}`

Error message

ArtifactId is empty in `${str}`

What it means

In one branch of GACT.split (when there is no classifier ':' before the artifact segment), the parsed artifactId turns out to be empty, so the library throws IllegalArgumentException naming the full input string. It guards against strings like "group::version" where the middle segment is empty.

Source

Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java:97

                    + "': groupId and artifactId separating character ':' is absent or not in the right place in the substring ending at index "
                    + fromIndex + ": '" + str.substring(0, fromIndex));
        }
        parts[3] = str.substring(i + 1, fromIndex);
        fromIndex = i;
        i = str.lastIndexOf(':', fromIndex - 1);
        if (i > 0) {
            if (i == fromIndex - 1) {
                parts[2] = ArtifactCoords.DEFAULT_CLASSIFIER;
            } else {
                parts[2] = str.substring(i + 1, fromIndex);
            }

            fromIndex = i;
            i = str.lastIndexOf(':', fromIndex - 1);
            if (i < 0) {
                parts[0] = str.substring(0, fromIndex);
                if ((parts[1] = parts[2]).isEmpty()) {
                    throw new IllegalArgumentException("ArtifactId is empty in `" + str + "`");
                }
                parts[2] = parts[3];
                parts[3] = null;
                return parts;
            }
            if (i == fromIndex - 1) {
                throw new IllegalArgumentException(
                        "One of groupId or artifactId is missing from '" + str.substring(0, fromIndex) + "'");
            }

            parts[0] = str.substring(0, i);
            parts[1] = str.substring(i + 1, fromIndex);
            if (parts[3].isEmpty()) {
                parts[3] = null;
            }
            return parts;
        }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Remove the empty segment so artifactId is non-empty (groupId:artifactId:version)
  2. Resolve all ${...} placeholders before parsing
  3. Pre-validate with a check that no ':'-delimited segment is empty

Example fix

// before
GACT.split("com.acme::1.0.0", new String[5], 10); // throws
// after
GACT.split("com.acme:app:1.0.0", new String[5], 14);
Defensive patterns

Strategy: validation

Validate before calling

boolean hasNonEmptySegments(String s) {
    return java.util.Arrays.stream(s.split(":", -1)).noneMatch(String::isEmpty);
}

Try / catch

try {
    GACT.split(str, parts, fromIndex);
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("ArtifactId is empty")) {
        throw new IllegalArgumentException("Fill in artifactId in: " + str);
    }
}

Prevention

When it happens

Trigger: Calling GACT.split with input such as "com.acme::1.0" — the ':' layout suggests a classifier-style 4-part string but the artifactId slot is empty.

Common situations: Unresolved property placeholders ("${groupId}::${version}"); double colons from concatenating an empty variable; hand-edited dependency lines in application.properties.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/2ce03b6d3e1ece42. Report an issue: GitHub.