{"record":{"id":"429ac671180d7f2f","repo":"quarkusio/quarkus","slug":"maven-purl-is-missing-a-namespace-groupid-for-na","errorCode":null,"errorMessage":"Maven PURL is missing a namespace (groupId) for name (artifactId) ","messagePattern":"Maven PURL is missing a namespace \\(groupId\\) for name \\(artifactId\\) ","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/app-model/src/main/java/io/quarkus/sbom/Purl.java","lineNumber":211,"sourceCode":"    private final Map<String, String> qualifiers;\n    private final String subpath;\n    private volatile String canonical;\n\n    private Purl(String type, String namespace, String name, String version,\n            Map<String, String> qualifiers, String subpath) {\n        Objects.requireNonNull(type, \"type is required\");\n        if (type.isEmpty()) {\n            throw new IllegalArgumentException(\"type must not be empty\");\n        }\n        validateType(type);\n        this.type = type.toLowerCase(Locale.ROOT);\n        this.namespace = namespace == null || namespace.isEmpty() ? null : namespace;\n        Objects.requireNonNull(name, \"name is required\");\n        if (name.isEmpty()) {\n            throw new IllegalArgumentException(\"name must not be empty\");\n        }\n        if (TYPE_MAVEN.equals(this.type) && this.namespace == null) {\n            throw new IllegalArgumentException(\"Maven PURL is missing a namespace (groupId) for name (artifactId) \" + name);\n        }\n        this.name = TYPE_NPM.equals(this.type) ? name.toLowerCase(Locale.ROOT) : name;\n        this.version = version;\n        this.qualifiers = qualifiers == null || qualifiers.isEmpty()\n                ? Map.of()\n                : qualifiers;\n        this.subpath = normalizeSubpath(subpath);\n    }\n\n    public String getType() {\n        return type;\n    }\n\n    public String getNamespace() {\n        return namespace;\n    }\n\n    public String getName() {","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/app-model/src/main/java/io/quarkus/sbom/Purl.java#L193-L229","documentation":"Purl's constructor throws this IllegalArgumentException when a Package URL of type 'maven' is built without a namespace. In the Maven coordinate scheme the namespace is the groupId, so it is mandatory; only the artifactId (name) was supplied. This is a fail-fast validation to keep generated PURLs spec-compliant.","triggerScenarios":"Calling new Purl(type, name, version, ...) (or the Purl.Builder for Maven) with type 'maven', an empty string namespace, or a namespace of null.","commonSituations":"Parsing Maven coordinates where only 'artifactId:version' was captured instead of 'groupId:artifactId:version'; building SBOM entries from dependency lists that dropped the groupId; passing empty-string group IDs from config or tooling output.","solutions":["Provide the Maven groupId as the namespace argument: new Purl(\"maven\", artifactId, version, /*namespace*/ groupId, ...)","If you have a full coordinate string, split it and map groupId->namespace, artifactId->name before constructing","If the groupId is genuinely unknown, resolve it from the pom.xml or dependency graph rather than passing null/empty"],"exampleFix":"// before\nnew Purl(\"maven\", \"commons-io\", \"2.15.0\", null, qualifiers);\n// after\nnew Purl(\"maven\", \"commons-io\", \"2.15.0\", \"commons-io\", qualifiers);","handlingStrategy":"validation","validationCode":"if (groupId == null || groupId.isEmpty()) {\n    throw new IllegalArgumentException(\"Maven PURL requires a groupId (namespace)\");\n}\nPurl p = new Purl(\"maven\", artifactId, version, groupId, qualifiers);","typeGuard":"boolean hasNamespace(Purl p) {\n    return p.getNamespace() != null && !p.getNamespace().isEmpty();\n}","tryCatchPattern":"try {\n    Purl p = new Purl(\"maven\", artifactId, version, groupId, qualifiers);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Maven PURL is missing a namespace\")) {\n        log.errorf(\"Cannot build PURL: groupId missing for artifact %s\", artifactId);\n    }\n}","preventionTips":["Always carry the full groupId:artifactId:version triple through your dependency pipeline","Normalize empty-string namespaces to null early and treat them as an error before constructing PURLs","Parse coordinates with a strict splitter that rejects 2-part groupId:artifactId pairs"],"tags":["sbom","purl","maven","validation"],"backgroundTag":"purl-maven-namespace-missing","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"}