quarkusio/quarkus · error · IllegalArgumentException
Invalid coordinates '${str}': groupId and artifactId separat
Error message
Invalid coordinates '${str}': groupId and artifactId separating character ':' is absent or not in the right place in the substring ending at index ${fromIndex}: '${str.substring(0, fromIndex)}' What it means
GACT.split(String, String[], int) parses trailing coordinate segments from a start index backwards; it throws IllegalArgumentException when searching backwards from fromIndex it cannot find a valid ':' separating groupId from artifactId (index <= 0). The substring ending at fromIndex therefore lacks a well-placed G:A separator.
Source
Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java:78
public GACT(String groupId, String artifactId) {
this(groupId, artifactId, null);
}
public GACT(String groupId, String artifactId, String classifier) {
this(groupId, artifactId, classifier, null);
}
public GACT(String groupId, String artifactId, String classifier, String type) {
this.groupId = groupId;
this.artifactId = artifactId;
this.classifier = classifier == null ? ArtifactCoords.DEFAULT_CLASSIFIER : classifier;
this.type = type;
}
public static String[] split(String str, String[] parts, int fromIndex) {
int i = str.lastIndexOf(':', fromIndex - 1);
if (i <= 0) {
throw new IllegalArgumentException("Invalid coordinates '" + str
+ "': 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()) {View on GitHub (pinned to e1c734241f)
Solutions
- Ensure the coordinate string contains groupId:artifactId before any classifier/type/version segments
- Check the segment before fromIndex contains at least one ':' not at index 0
- If you only have artifactId, prepend the groupId you intend to use
Example fix
// before
GACT.split("app:1.0", new String[5], 3); // throws
// after
GACT.split("com.acme:app:1.0", new String[5], 11); Defensive patterns
Strategy: validation
Validate before calling
boolean hasGaSeparator(String s, int fromIndex) {
int i = s.lastIndexOf(':', fromIndex - 1);
return i > 0;
} Try / catch
try {
GACT.split(str, parts, fromIndex);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Missing groupId:artifactId before index " + fromIndex + " in " + str);
} Prevention
- Always include groupId:artifactId at the start of coordinate strings
- When calling split directly, verify fromIndex points past a complete G:A prefix
- Prefer the higher-level ArtifactCoords parse methods over manual split calls
- Reject strings whose only ':' is at index 0
When it happens
Trigger: Calling GACT.split directly (or indirectly via ArtifactCoords.split) with a fromIndex whose preceding substring has no ':' or has ':' at position 0 — e.g. "artifact:1.0" parsed with fromIndex=5, or ":jar:1.0".
Common situations: Passing coords missing the groupId (artifactId-only strings); custom parsers computing fromIndex incorrectly; strings where the only ':' is at the very start.
Related errors
- One of type, version or separating them ':' is missing from
- ${coords} does not follow format <groupId>:<artifactId>[:<cl
- One of groupId or artifactId is missing from '${str.substrin
- Invalid workspace module ID string: ${str}
- ArtifactCoordsSegmentPattern.of() expects groupId:artifactId
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/dbb84ac2419c36d9.
Report an issue: GitHub.