{"record":{"id":"03da49193e44c816","repo":"quarkusio/quarkus","slug":"invalid-workspace-module-id-string-str","errorCode":null,"errorMessage":"Invalid workspace module ID string: ${str}","messagePattern":"Invalid workspace module ID string: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/workspace/WorkspaceModuleId.java","lineNumber":14,"sourceCode":"package io.quarkus.bootstrap.workspace;\n\nimport io.quarkus.maven.dependency.GAV;\n\npublic interface WorkspaceModuleId {\n\n    static WorkspaceModuleId of(String groupId, String artifactId, String version) {\n        return new GAV(groupId, artifactId, version);\n    }\n\n    static WorkspaceModuleId fromString(String str) {\n        final String[] arr = str.split(\":\");\n        if (arr.length != 3) {\n            throw new IllegalArgumentException(\"Invalid workspace module ID string: \" + str);\n        }\n        return of(arr[0], arr[1], arr[2]);\n    }\n\n    String getGroupId();\n\n    String getArtifactId();\n\n    String getVersion();\n}\n","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/bootstrap/workspace/WorkspaceModuleId.java#L1-L25","documentation":"WorkspaceModuleId.fromString parses a colon-separated string and throws IllegalArgumentException if it does not split into exactly 3 parts (groupId:artifactId:version). The library requires the strict GAV form for module ids.","triggerScenarios":"Calling WorkspaceModuleId.fromString(str) where str contains fewer or more than two ':' characters, e.g. \"com.acme:app\" or \"com.acme:app:1.0:extra\".","commonSituations":"Reading module ids from config files or environment variables with typos; passing Maven artifact strings that include classifier/type (5 segments) instead of the 3-segment GAV; trimming or joining errors when composing the string.","solutions":["Pass exactly groupId:artifactId:version with two ':' separators","If your input has classifier/type, strip the extra segments before calling fromString","Validate with a split(':').length == 3 check before calling"],"exampleFix":"// before\nWorkspaceModuleId id = WorkspaceModuleId.fromString(\"com.acme:app\"); // throws\n// after\nWorkspaceModuleId id = WorkspaceModuleId.fromString(\"com.acme:app:1.0.0\");","handlingStrategy":"validation","validationCode":"boolean isValidModuleId(String s) {\n    return s != null && s.split(\":\", -1).length == 3;\n}","typeGuard":"Optional<WorkspaceModuleId> tryParseModuleId(String s) {\n    String[] a = s == null ? new String[0] : s.split(\":\", -1);\n    return a.length == 3\n        ? Optional.of(WorkspaceModuleId.of(a[0], a[1], a[2]))\n        : Optional.empty();\n}","tryCatchPattern":"try {\n    id = WorkspaceModuleId.fromString(str);\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"Expected groupId:artifactId:version, got: \" + str, e);\n}","preventionTips":["Always build ids via WorkspaceModuleId.of(groupId, artifactId, version) instead of string parsing","Validate config-derived strings match ^[^:]+:[^:]+:[^:]+$ before parsing","Strip classifier/type segments from Maven-style coords before calling fromString"],"tags":["parsing","gav-coordinates","format-validation","workspace"],"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-14T00:17:10.932Z"}