{"record":{"id":"74fda3e737fcaf19","repo":"quarkusio/quarkus","slug":"bad-artifact-coordinates-expected-format-is-gro","errorCode":null,"errorMessage":"Bad artifact coordinates , expected format is <groupId>:<artifactId>[:<extension>|[:<classifier>:<extension>]]:<version>","messagePattern":"Bad artifact coordinates , expected format is <groupId>:<artifactId>\\[:<extension>\\|\\[:<classifier>:<extension>\\]\\]:<version>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/util/DependencyUtils.java","lineNumber":185,"sourceCode":"                offset = colon + 1;\n                colon = str.indexOf(':', offset);\n                if (colon < 0) {\n                    version = str.substring(offset, length);\n                } else {\n                    if (colon == length - 1) {\n                        illegalDependencyFormat(str);\n                    }\n                    classifier = type;\n                    type = str.substring(offset, colon);\n                    version = str.substring(colon + 1);\n                }\n            }\n        }\n        return new DefaultArtifact(groupId, artifactId, classifier, type, version);\n    }\n\n    private static void illegalDependencyFormat(String str) {\n        throw new IllegalArgumentException(\"Bad artifact coordinates \" + str\n                + \", expected format is <groupId>:<artifactId>[:<extension>|[:<classifier>:<extension>]]:<version>\");\n    }\n\n    public static ResolvedDependencyBuilder newDependencyBuilder(DependencyNode node, MavenArtifactResolver resolver)\n            throws BootstrapMavenException {\n        var artifact = node.getDependency().getArtifact();\n        if (artifact.getFile() == null) {\n            artifact = resolver.resolve(artifact, node.getRepositories()).getArtifact();\n        }\n        int flags = 0;\n        if (node.getDependency().isOptional()) {\n            flags |= DependencyFlags.OPTIONAL;\n        }\n        WorkspaceModule module = null;\n        if (resolver.getProjectModuleResolver() != null) {\n            module = resolver.getProjectModuleResolver().getProjectModule(artifact.getGroupId(), artifact.getArtifactId(),\n                    artifact.getVersion());\n            if (module != null) {","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/util/DependencyUtils.java#L167-L203","documentation":"DependencyUtils.toArtifact parses a coordinate string into a Maven DefaultArtifact. Strings not matching groupId:artifactId[:extension][:classifier]:extension:version structure are rejected by illegalDependencyFormat with this IllegalArgumentException. The parser cannot recover partial coordinates.","triggerScenarios":"Passing a malformed coordinates string to the DependencyUtils/Bootstrap artifact-parsing API: missing version, too few or too many colon-separated segments, or empty segments (e.g. 'org.acme:app' with no version, or a stray trailing ':').","commonSituations":"Configuration properties (quarkus.platform.group-id etc., extensions lists) where a user forgot the :version; programmatically built coordinate strings where an empty variable was interpolated; hand-edited POM properties containing artifact keys.","solutions":["Supply the full coordinates including the version: groupId:artifactId:version (or with extension/classifier segments in the documented order)","Print the offending string (it is echoed in the message) and count the ':' segments against the expected format","If coordinates are built dynamically, check the interpolated variables are non-empty","Validate with 'mvn dependency:get -Dartifact=...' to confirm the coordinates are syntactically valid"],"exampleFix":"// before\nString coords = \"org.acme:my-extension\"; // no version\nDependencyUtils.toArtifact(coords);\n// after\nString coords = \"org.acme:my-extension:jar:1.0.0\";\nDependencyUtils.toArtifact(coords);","handlingStrategy":"validation","validationCode":"boolean validCoords(String s) {\n    if (s == null || s.isEmpty()) return false;\n    String[] parts = s.split(\":\");\n    return parts.length >= 3 && parts.length <= 5\n        && java.util.Arrays.stream(parts).allMatch(p -> !p.isEmpty());\n}\nif (!validCoords(coords)) throw new IllegalArgumentException(\"Bad coordinates: \" + coords);","typeGuard":null,"tryCatchPattern":"try {\n    Artifact a = DependencyUtils.toArtifact(coords);\n} catch (IllegalArgumentException e) {\n    log.error(\"Fix coordinate string: \" + e.getMessage());\n}","preventionTips":["Always include the version in coordinate strings","Validate interpolated variables are non-empty before building coordinates","Count ':' segments against groupId:artifactId[:extension][:classifier]:extension:version","Test parsing of configured coordinates at startup with clear errors"],"tags":["maven","coordinates","parsing"],"backgroundTag":"malformed-artifact-coordinates","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"}