{"record":{"id":"36bbc958e3c60b60","repo":"quarkusio/quarkus","slug":"one-of-type-version-or-separating-them-is-mis-36bbc9","errorCode":null,"errorMessage":"One of type, version or separating them ':' is missing from '${str}'","messagePattern":"One of type, version or separating them ':' is missing from '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACTV.java","lineNumber":25,"sourceCode":"\n    private static final long serialVersionUID = -8362130311897578173L;\n\n    public static GACTV fromString(String str) {\n        return new GACTV(split(str, new String[5]));\n    }\n\n    public static ArtifactCoords pom(String groupId, String artifactId, String version) {\n        return new GACTV(groupId, artifactId, null, TYPE_POM, version);\n    }\n\n    public static ArtifactCoords jar(String groupId, String artifactId, String version) {\n        return new GACTV(groupId, artifactId, null, TYPE_JAR, version);\n    }\n\n    protected static String[] split(String str, String[] parts) {\n        final int versionSep = str.lastIndexOf(':');\n        if (versionSep <= 0 || versionSep == str.length() - 1) {\n            throw new IllegalArgumentException(\"One of type, version or separating them ':' is missing from '\" + str + \"'\");\n        }\n        parts[4] = str.substring(versionSep + 1);\n        return GACT.split(str, parts, versionSep);\n    }\n\n    private final String groupId;\n    private final String artifactId;\n    private final String classifier;\n    private final String type;\n    private final String version;\n\n    private transient ArtifactKey key;\n\n    protected GACTV(String[] parts) {\n        groupId = parts[0];\n        artifactId = parts[1];\n        classifier = parts[2] == null ? DEFAULT_CLASSIFIER : parts[2];\n        type = parts[3] == null ? TYPE_JAR : parts[3];","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACTV.java#L7-L43","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nGACTV.fromString(\"io.quarkus:quarkus-core\");\n// after\nGACTV.fromString(\"io.quarkus:quarkus-core:jar:3.0.0.Final\");","handlingStrategy":"validation","validationCode":"boolean isParseableCoordinate(String s) {\n    return s != null && s.matches(\"[^:]+:[^:]+:[^:]+:[^:]+\"); // g:a:t:v\n}","typeGuard":null,"tryCatchPattern":"try {\n    GACTV coord = GACTV.fromString(raw);\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Bad coordinate '\" + raw + \"', expected groupId:artifactId:type:version\", e);\n}","preventionTips":["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"],"tags":["parsing","maven-coordinates","illegal-argument"],"backgroundTag":"invalid-dependency-coordinate","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}