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
- Remove the empty segment so artifactId is non-empty (groupId:artifactId:version)
- Resolve all ${...} placeholders before parsing
- 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
- Check for '::' in coordinate strings before parsing
- Resolve ${...} placeholders; empty variables create empty segments
- Split on ':' in a pre-check and fail with your own message naming the empty segment
- Avoid manual string concatenation of coordinate parts
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
- One of type, version or separating them ':' is missing from
- ${coords} does not follow format <groupId>:<artifactId>[:<cl
- Invalid coordinates '${str}': groupId and artifactId separat
- One of groupId or artifactId is missing from '${str.substrin
- One of type, version or separating them ':' is missing from
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/2ce03b6d3e1ece42.
Report an issue: GitHub.