{"record":{"id":"fb5d0ca3ab2adfab","repo":"theonedev/onedev","slug":"no-artifact-id","errorCode":null,"errorMessage":"No artifact id","messagePattern":"No artifact id","errorType":"http","errorClass":"HttpResponseAwareException","httpStatus":400,"severity":"warning","filePath":"server-plugin/server-plugin-pack-maven/src/main/java/io/onedev/server/plugin/pack/maven/MavenPackHandler.java","lineNumber":466,"sourceCode":"\t\tcriteria.add(Restrictions.eq(PROP_PROJECT, project));\n\t\tcriteria.add(Restrictions.eq(PROP_TYPE, TYPE));\n\t\tcriteria.add(Restrictions.eq(PROP_NAME, getName(groupId, artifactId)));\n\t\tcriteria.add(Restrictions.not(Restrictions.eq(PROP_VERSION, NONE)));\n\t\treturn packService.query(criteria);\n\t}\n\t\n\tprivate Pack findPack(Project project, String groupId, @Nullable String artifactId,\n\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":448,"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#L448-L484","documentation":"getGroupIdAndArtifactId derives the Maven coordinates from the request's path segments: the last segment is the artifactId (file name), the preceding segments form the groupId. If the path has no segments at all, there is nothing to interpret as an artifact id, so the handler throws HTTP 400 'No artifact id'.","triggerScenarios":"A request reaches the Maven pack handler with an empty or root path — e.g. GET/PUT against the repository base URL without an artifact path (misconfigured repository URL, health check hitting the repo endpoint, client stripping the path).","commonSituations":"Repository URL missing its path in settings.xml; proxy rewrite dropping the artifact path; manual curl to the repo root; truncated URL after a redirect.","solutions":["Fix the repository URL so it includes the full artifact path, e.g. https://host/~maven/<projectId>/com/acme/app/1.0/app-1.0.jar.","Check any reverse-proxy rewrite rules that strip path segments before the request reaches OneDev.","Point build tools at the repository root, not the pack-handler endpoint, and let Maven/Gradle construct artifact paths."],"exampleFix":"// before (settings.xml) — URL without project scope leads to empty path requests\n<url>https://onedev.example.com/~maven</url>\n// after\n<url>https://onedev.example.com/~maven/1</url>","handlingStrategy":"validation","validationCode":"# Sanity-check the repository URL resolves to a real artifact path before use\nURL=\"$BASE/~maven/1/com/acme/app/1.0.0/app-1.0.0.pom\"\ncase \"$URL\" in\n  */*.jar|*/*.pom|*/*.xml|*/*.sha1|*/*.md5) echo \"artifact path ok\" ;;\n  *) echo \"URL lacks artifact path: $URL\"; exit 1 ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure the repository with the full scoped URL including project id.","Let Maven/Gradle build artifact paths; avoid hand-writing requests to the endpoint root.","Check proxy/redirect configurations for path rewriting that drops segments."],"tags":["maven","bad-request","url-path","coordinates"],"backgroundTag":"missing-required-argument","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"}