{"record":{"id":"21440bc374f7feaa","repo":"theonedev/onedev","slug":"no-group-id","errorCode":null,"errorMessage":"No group id","messagePattern":"No group id","errorType":"http","errorClass":"HttpResponseAwareException","httpStatus":400,"severity":"error","filePath":"server-plugin/server-plugin-pack-maven/src/main/java/io/onedev/server/plugin/pack/maven/MavenPackHandler.java","lineNumber":474,"sourceCode":"\t\t\t\t\t\t  @Nullable String version) {\n\t\tif (artifactId == null)\n\t\t\tartifactId = NONE;\n\t\tif (version == null)\n\t\t\tversion = NONE;\n\t\treturn packService.findByNameAndVersion(project, TYPE, getName(groupId, artifactId), version);\n\t}\n\n\tprivate Pair<String, String> getGroupIdAndArtifactId(List<String> pathSegments) {\n\t\tif (pathSegments.isEmpty())\n\t\t\tthrow new HttpResponseAwareException(SC_BAD_REQUEST, \"No artifact id\");\n\t\tvar artifactId = pathSegments.get(pathSegments.size()-1);\n\t\tpathSegments = pathSegments.subList(0, pathSegments.size()-1);\n\t\treturn new Pair<>(getGroupId(pathSegments), artifactId);\n\t}\n\n\tprivate String getGroupId(List<String> pathSegments) {\n\t\tif (pathSegments.isEmpty())\n\t\t\tthrow new HttpResponseAwareException(SC_BAD_REQUEST, \"No group id\");\n\t\treturn StringUtils.join(pathSegments, \".\");\n\t}\n\n\t@Override\n\tpublic List<String> normalize(List<String> pathSegments) {\n\t\treturn pathSegments;\n\t}\n\t\n}\n","sourceCodeStart":456,"sourceCodeEnd":484,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-plugin/server-plugin-pack-maven/src/main/java/io/onedev/server/plugin/pack/maven/MavenPackHandler.java#L456-L484","documentation":"OneDev's Maven pack handler derives the Maven groupId from the leading path segments of a repository request path. If the request path yields no group segments (the segment list is empty after peeling off the artifactId), getGroupId throws HttpResponseAwareException mapped to HTTP 400 Bad Request with message 'No group id'.","triggerScenarios":"A GET/PUT request reaches the Maven pack endpoint with a path that resolves to only an artifactId with no preceding group segments, e.g. requesting the bare root path or a path where every segment is consumed by other parsing so the subList passed to getGroupId is empty.","commonSituations":"Misconfigured Maven client repository URLs missing the group path portion (e.g. using base URL without the com/example coordinates path); accidental double slashes collapsing path segments; malformed deploy URLs constructed by tooling or scripts that strip segments.","solutions":["Fix the client repository/deploy URL to include the full Maven coordinate path: /<groupId dots as slashes>/<artifactId>/<version>/<file>","Check for double slashes or an empty path prefix in the configured URL","Verify the request is being routed to the Maven pack handler for the right project rather than the project root path","Log the full request path and confirm pathSegments construction before calling getGroupId"],"exampleFix":"// before (client config)\nurl = \"http://onedev.example.com/~projects/myproj/maven\"  // no coordinate path\n// after\nurl = \"http://onedev.example.com/~projects/myproj/maven/com/example/artifact/1.0/artifact-1.0.jar\"","handlingStrategy":"validation","validationCode":"const segments = new URL(repoUrl).pathname.split('/').filter(Boolean);\nif (segments.length < 2) throw new Error('Maven pack URL must include group path, e.g. /com/example/artifact/...');","typeGuard":null,"tryCatchPattern":"try { await deployArtifact(url) } catch (e) { if (e.response?.status === 400 && /No group id/i.test(e.message ?? '')) { console.error('Repository URL missing group path segments'); } else throw e }","preventionTips":["Always build Maven repository URLs from full GAV coordinates","Reject/normalize URLs with empty or doubled path segments before requests","Test deploy URLs with a dry run before CI publishing"],"tags":["http-400","maven","bad-request-path","pack-api"],"backgroundTag":"invalid-url-format","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}