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
ArtifactCoords.split locates the version by the last ':' and requires at least one character before it and after it. It throws IllegalArgumentException when the version separator ':' is missing entirely, is the first character, or is the last character of the string — meaning type and/or version cannot be determined.
Source
Thrown at independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/ArtifactCoords.java:28
* WARNING: DO NOT USE THIS CLASS
* <p>
*
* @deprecated in favor of {@link io.quarkus.maven.dependency.ArtifactCoords}
*/
public class ArtifactCoords implements io.quarkus.maven.dependency.ArtifactCoords, Serializable {
public static ArtifactCoords fromString(String str) {
return new ArtifactCoords(split(str, new String[5]));
}
public static ArtifactCoords pom(String groupId, String artifactId, String version) {
return new ArtifactCoords(groupId, artifactId, ArtifactCoords.DEFAULT_CLASSIFIER, TYPE_POM, 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);
}
protected final String groupId;
protected final String artifactId;
protected final String classifier;
protected final String type;
protected final String version;
protected transient ArtifactKey key;
protected ArtifactCoords(String[] parts) {
groupId = parts[0];
artifactId = parts[1];
classifier = parts[2];
type = parts[3] == null ? TYPE_JAR : parts[3];View on GitHub (pinned to e1c734241f)
Solutions
- Include a version as the segment after the last ':' (groupId:artifactId[:classifier][:type]:version)
- Resolve any property placeholders (${...}) before parsing
- Pre-validate with str.lastIndexOf(':') > 0 && < str.length() - 1
- If only a GAV is known, use a GAV-only API (WorkspaceModuleId) instead of full ArtifactCoords
Example fix
// before
ArtifactCoords c = ArtifactCoords.fromString("com.acme:app"); // throws
// after
ArtifactCoords c = ArtifactCoords.fromString("com.acme:app:jar:1.0.0"); Defensive patterns
Strategy: validation
Validate before calling
boolean hasVersionSegment(String s) {
int i = s == null ? -1 : s.lastIndexOf(':');
return i > 0 && i < s.length() - 1;
} Try / catch
try {
ArtifactCoords c = ArtifactCoords.fromString(str);
} catch (IllegalArgumentException e) {
if (e.getMessage().contains(":' is missing")) {
throw new IllegalArgumentException("Append a version, e.g. " + str + ":1.0.0");
}
} Prevention
- Never hand-build coordinate strings without a version
- Resolve ${...} placeholders before parsing coordinates
- Use Builder-style APIs (ArtifactCoords.of(g,a,c,t,v)) rather than string parsing
- Trim whitespace; trailing spaces can push ':' to the last position
When it happens
Trigger: Calling ArtifactCoords.fromString / GACTV parsing helpers with strings like "com.acme:app" (no version), "com.acme:app:" (trailing colon), or ":1.0" (leading colon).
Common situations: Users supply dependency strings copied from BOM entries or property placeholders that lost their version (e.g. "${group}:${artifact}:" unresolved); config values with trailing whitespace stripped incorrectly; hand-written coords omitting the version.
Related errors
- ${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
- 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/fcb533e3082eba1a.
Report an issue: GitHub.