theonedev/onedev · warning · HttpResponseAwareException

No artifact id

Error message

No artifact id

What it means

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'.

Source

Thrown at server-plugin/server-plugin-pack-maven/src/main/java/io/onedev/server/plugin/pack/maven/MavenPackHandler.java:466

		criteria.add(Restrictions.eq(PROP_PROJECT, project));
		criteria.add(Restrictions.eq(PROP_TYPE, TYPE));
		criteria.add(Restrictions.eq(PROP_NAME, getName(groupId, artifactId)));
		criteria.add(Restrictions.not(Restrictions.eq(PROP_VERSION, NONE)));
		return packService.query(criteria);
	}
	
	private Pack findPack(Project project, String groupId, @Nullable String artifactId,
						  @Nullable String version) {
		if (artifactId == null)
			artifactId = NONE;
		if (version == null)
			version = NONE;
		return packService.findByNameAndVersion(project, TYPE, getName(groupId, artifactId), version);
	}

	private Pair<String, String> getGroupIdAndArtifactId(List<String> pathSegments) {
		if (pathSegments.isEmpty())
			throw new HttpResponseAwareException(SC_BAD_REQUEST, "No artifact id");
		var artifactId = pathSegments.get(pathSegments.size()-1);
		pathSegments = pathSegments.subList(0, pathSegments.size()-1);
		return new Pair<>(getGroupId(pathSegments), artifactId);
	}

	private String getGroupId(List<String> pathSegments) {
		if (pathSegments.isEmpty())
			throw new HttpResponseAwareException(SC_BAD_REQUEST, "No group id");
		return StringUtils.join(pathSegments, ".");
	}

	@Override
	public List<String> normalize(List<String> pathSegments) {
		return pathSegments;
	}
	
}

View on GitHub (pinned to d44925c47c)

Solutions

  1. 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.
  2. Check any reverse-proxy rewrite rules that strip path segments before the request reaches OneDev.
  3. Point build tools at the repository root, not the pack-handler endpoint, and let Maven/Gradle construct artifact paths.

Example fix

// before (settings.xml) — URL without project scope leads to empty path requests
<url>https://onedev.example.com/~maven</url>
// after
<url>https://onedev.example.com/~maven/1</url>
Defensive patterns

Strategy: validation

Validate before calling

# Sanity-check the repository URL resolves to a real artifact path before use
URL="$BASE/~maven/1/com/acme/app/1.0.0/app-1.0.0.pom"
case "$URL" in
  */*.jar|*/*.pom|*/*.xml|*/*.sha1|*/*.md5) echo "artifact path ok" ;;
  *) echo "URL lacks artifact path: $URL"; exit 1 ;;
esac

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/fb5d0ca3ab2adfab. Report an issue: GitHub.