{"record":{"id":"dbb84ac2419c36d9","repo":"quarkusio/quarkus","slug":"invalid-coordinates-str-groupid-and-artifact","errorCode":null,"errorMessage":"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)}'","messagePattern":"Invalid coordinates '(.+?)': groupId and artifactId separating character ':' is absent or not in the right place in the substring ending at index (.+?): '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java","lineNumber":78,"sourceCode":"    public GACT(String groupId, String artifactId) {\n        this(groupId, artifactId, null);\n    }\n\n    public GACT(String groupId, String artifactId, String classifier) {\n        this(groupId, artifactId, classifier, null);\n    }\n\n    public GACT(String groupId, String artifactId, String classifier, String type) {\n        this.groupId = groupId;\n        this.artifactId = artifactId;\n        this.classifier = classifier == null ? ArtifactCoords.DEFAULT_CLASSIFIER : classifier;\n        this.type = type;\n    }\n\n    public static String[] split(String str, String[] parts, int fromIndex) {\n        int i = str.lastIndexOf(':', fromIndex - 1);\n        if (i <= 0) {\n            throw new IllegalArgumentException(\"Invalid coordinates '\" + str\n                    + \"': groupId and artifactId separating character ':' is absent or not in the right place in the substring ending at index \"\n                    + fromIndex + \": '\" + str.substring(0, fromIndex));\n        }\n        parts[3] = str.substring(i + 1, fromIndex);\n        fromIndex = i;\n        i = str.lastIndexOf(':', fromIndex - 1);\n        if (i > 0) {\n            if (i == fromIndex - 1) {\n                parts[2] = ArtifactCoords.DEFAULT_CLASSIFIER;\n            } else {\n                parts[2] = str.substring(i + 1, fromIndex);\n            }\n\n            fromIndex = i;\n            i = str.lastIndexOf(':', fromIndex - 1);\n            if (i < 0) {\n                parts[0] = str.substring(0, fromIndex);\n                if ((parts[1] = parts[2]).isEmpty()) {","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java#L60-L96","documentation":"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.","triggerScenarios":"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\".","commonSituations":"Passing coords missing the groupId (artifactId-only strings); custom parsers computing fromIndex incorrectly; strings where the only ':' is at the very start.","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"],"exampleFix":"// before\nGACT.split(\"app:1.0\", new String[5], 3); // throws\n// after\nGACT.split(\"com.acme:app:1.0\", new String[5], 11);","handlingStrategy":"validation","validationCode":"boolean hasGaSeparator(String s, int fromIndex) {\n    int i = s.lastIndexOf(':', fromIndex - 1);\n    return i > 0;\n}","typeGuard":null,"tryCatchPattern":"try {\n    GACT.split(str, parts, fromIndex);\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Missing groupId:artifactId before index \" + fromIndex + \" in \" + str);\n}","preventionTips":["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"],"tags":["parsing","maven-coordinates","format-validation"],"backgroundTag":"invalid-coordinate-format","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}