apache/maven · warning · InvalidArtifactRTException
The groupId cannot be empty.
Error message
The groupId cannot be empty.
What it means
After a download completes, DefaultWagonManager verifies the SHA-1 checksum. On the FIRST failure it assumes a transient server problem (the classic mirror bug: an HTTP-200 error page delivered instead of the file) and logs this warning, then re-downloads the artifact. On the second consecutive failure the repository's checksum policy (fail/warn/ignore) decides the outcome.
Source
Thrown at compat/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java:167
this.scope = scope;
this.type = type;
if (classifier == null) {
classifier = artifactHandler.getClassifier();
}
this.classifier = classifier;
this.optional = optional;
validateIdentity();
}
private void validateIdentity() {
if (empty(groupId)) {
throw new InvalidArtifactRTException(
groupId, artifactId, getVersion(), type, "The groupId cannot be empty.");
}
if (empty(artifactId)) {
throw new InvalidArtifactRTException(
groupId, artifactId, getVersion(), type, "The artifactId cannot be empty.");
}
if (empty(type)) {
throw new InvalidArtifactRTException(groupId, artifactId, getVersion(), type, "The type cannot be empty.");
}
if ((empty(version)) && (versionRange == null)) {
throw new InvalidArtifactRTException(
groupId, artifactId, getVersion(), type, "The version cannot be empty.");
}
}
View on GitHub (pinned to e4093d4e12)
Solutions
- Let the automatic retry run; if the second attempt also fails, address the serving repository itself
- Point mirrors at canonical Central (https://repo.maven.apache.org/maven2) instead of unmaintained intermediates
- Delete the artifact from the local repository and rebuild with -U to force a clean fetch
- Compare manually: curl the artifact and its .sha1 and check sha1sum to see which side is wrong
Example fix
<!-- before --> <mirror> <id>flaky-mirror</id> <url>http://mymirror.example.com/maven2</url> <mirrorOf>central</mirrorOf> </mirror> <!-- after: canonical Central --> <mirror> <id>central-fast</id> <url>https://repo.maven.apache.org/maven2</url> <mirrorOf>central</mirrorOf> </mirror>
Defensive patterns
Strategy: retry
Validate before calling
url=https://repo.maven.apache.org/maven2/path/to/artifact-1.0.jar curl -fsS $url -o /tmp/a.jar && curl -fsS $url.sha1 -o /tmp/a.sha1 [ "$(sha1sum /tmp/a.jar | cut -d' ' -f1)" = "$(cat /tmp/a.sha1)" ] \ || echo 'repo checksum broken; pick another mirror'
Prevention
- Mirror Central from repo.maven.apache.org/maven2, not unmaintained third-party mirrors
- Delete local copies of any artifact that failed checksum verification twice
- Use checksumPolicy=fail in CI so persistent corruption is visible immediately
When it happens
Trigger: SHA-1 mismatch on the first verification: truncated or corrupted transfer, a mirror serving stale or wrong .sha1 files, or middleboxes rewriting response bodies.
Common situations: Third-party mirrors of Central lagging behind; flaky corporate proxies; interrupted network links during CI artifact fetches.
Related errors
- The type cannot be empty.
- artifactId can neither be null, empty nor blank
- version can neither be null, empty nor blank
- Unable to store local copy of metadata: {}
- Repository list contains duplicate entries. Each repository
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/25b219cba436d4ff.
Report an issue: GitHub.