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

  1. Include a version as the segment after the last ':' (groupId:artifactId[:classifier][:type]:version)
  2. Resolve any property placeholders (${...}) before parsing
  3. Pre-validate with str.lastIndexOf(':') > 0 && < str.length() - 1
  4. 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

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


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