quarkusio/quarkus · error · IllegalArgumentException
One of type, version or separating them ':' is missing from
Error message
One of type, version or separating them ':' is missing from '${str}' What it means
GACTV.parse/fromString parses a 'group:artifact:type:version' coordinate string. split() requires a colon that separates the type and version: it must not be the first character and must not be the last character. If the string lacks a valid ':type:version' suffix, IllegalArgumentException is thrown.
Source
Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACTV.java:25
private static final long serialVersionUID = -8362130311897578173L;
public static GACTV fromString(String str) {
return new GACTV(split(str, new String[5]));
}
public static ArtifactCoords pom(String groupId, String artifactId, String version) {
return new GACTV(groupId, artifactId, null, TYPE_POM, version);
}
public static ArtifactCoords jar(String groupId, String artifactId, String version) {
return new GACTV(groupId, artifactId, null, TYPE_JAR, version);
}
protected static String[] split(String str, String[] parts) {
final int versionSep = str.lastIndexOf(':');
if (versionSep <= 0 || versionSep == str.length() - 1) {
throw new IllegalArgumentException("One of type, version or separating them ':' is missing from '" + str + "'");
}
parts[4] = str.substring(versionSep + 1);
return GACT.split(str, parts, versionSep);
}
private final String groupId;
private final String artifactId;
private final String classifier;
private final String type;
private final String version;
private transient ArtifactKey key;
protected GACTV(String[] parts) {
groupId = parts[0];
artifactId = parts[1];
classifier = parts[2] == null ? DEFAULT_CLASSIFIER : parts[2];
type = parts[3] == null ? TYPE_JAR : parts[3];View on GitHub (pinned to e1c734241f)
Solutions
- Pass a full coordinate string of the form groupId:artifactId:type:version, e.g. 'org.acme:app:jar:1.0.0'
- If the type is optional, use the GACTV variant that defaults to jar, but still supply a version: 'org.acme:app:jar:1.0.0'
- Trim stray trailing/leading colons from the input string before parsing
- Validate the string with a regex like ^[^:]+(:[^:]+){3}$ before calling fromString
Example fix
// before
GACTV.fromString("io.quarkus:quarkus-core");
// after
GACTV.fromString("io.quarkus:quarkus-core:jar:3.0.0.Final"); Defensive patterns
Strategy: validation
Validate before calling
boolean isParseableCoordinate(String s) {
return s != null && s.matches("[^:]+:[^:]+:[^:]+:[^:]+"); // g:a:t:v
} Try / catch
try {
GACTV coord = GACTV.fromString(raw);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Bad coordinate '" + raw + "', expected groupId:artifactId:type:version", e);
} Prevention
- Always supply type and version in coordinate strings (g:a:t:v)
- Trim whitespace and stray colons from user/config input before parsing
- Validate coordinates with a regex before calling fromString
- Prefer building coordinates programmatically (new GACTV(...)) over string parsing when possible
When it happens
Trigger: Calling GACTV.fromString(str) or GACTV.parse(str) with a string whose lastIndexOf(':') is 0 (only a leading colon), or equals str.length()-1 (trailing colon with empty version), or where no colon exists after the version position.
Common situations: Hand-written dependency coordinates in configuration or CLI args like 'org.foo:bar' (missing type/version) or 'org.foo:bar:jar:' (trailing colon); copy-paste of Maven coordinates that omit type and version; properties files with truncated values.
Related errors
- Unexpected end of input: ${str}
- 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
- ArtifactId is empty in `${str}`
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/36bbc958e3c60b60.
Report an issue: GitHub.