{"record":{"id":"2ce03b6d3e1ece42","repo":"quarkusio/quarkus","slug":"artifactid-is-empty-in-str","errorCode":null,"errorMessage":"ArtifactId is empty in `${str}`","messagePattern":"ArtifactId is empty in `(.+?)`","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java","lineNumber":97,"sourceCode":"                    + \"': 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()) {\n                    throw new IllegalArgumentException(\"ArtifactId is empty in `\" + str + \"`\");\n                }\n                parts[2] = parts[3];\n                parts[3] = null;\n                return parts;\n            }\n            if (i == fromIndex - 1) {\n                throw new IllegalArgumentException(\n                        \"One of groupId or artifactId is missing from '\" + str.substring(0, fromIndex) + \"'\");\n            }\n\n            parts[0] = str.substring(0, i);\n            parts[1] = str.substring(i + 1, fromIndex);\n            if (parts[3].isEmpty()) {\n                parts[3] = null;\n            }\n            return parts;\n        }\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/maven/dependency/GACT.java#L79-L115","documentation":"In one branch of GACT.split (when there is no classifier ':' before the artifact segment), the parsed artifactId turns out to be empty, so the library throws IllegalArgumentException naming the full input string. It guards against strings like \"group::version\" where the middle segment is empty.","triggerScenarios":"Calling GACT.split with input such as \"com.acme::1.0\" — the ':' layout suggests a classifier-style 4-part string but the artifactId slot is empty.","commonSituations":"Unresolved property placeholders (\"${groupId}::${version}\"); double colons from concatenating an empty variable; hand-edited dependency lines in application.properties.","solutions":["Remove the empty segment so artifactId is non-empty (groupId:artifactId:version)","Resolve all ${...} placeholders before parsing","Pre-validate with a check that no ':'-delimited segment is empty"],"exampleFix":"// before\nGACT.split(\"com.acme::1.0.0\", new String[5], 10); // throws\n// after\nGACT.split(\"com.acme:app:1.0.0\", new String[5], 14);","handlingStrategy":"validation","validationCode":"boolean hasNonEmptySegments(String s) {\n    return java.util.Arrays.stream(s.split(\":\", -1)).noneMatch(String::isEmpty);\n}","typeGuard":null,"tryCatchPattern":"try {\n    GACT.split(str, parts, fromIndex);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"ArtifactId is empty\")) {\n        throw new IllegalArgumentException(\"Fill in artifactId in: \" + str);\n    }\n}","preventionTips":["Check for '::' in coordinate strings before parsing","Resolve ${...} placeholders; empty variables create empty segments","Split on ':' in a pre-check and fail with your own message naming the empty segment","Avoid manual string concatenation of coordinate parts"],"tags":["parsing","maven-coordinates","empty-segment"],"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"}