apache/maven · warning · InvalidArtifactRTException
The artifactId cannot be empty.
Error message
The artifactId cannot be empty.
What it means
After a transfer, DefaultWagonManager.cleanupTemporaryFiles deletes the temporary files used during download. File.delete() returned false, meaning the file is held or locked by another process, so Maven warns and registers deleteOnExit() as a safety net before moving on. This is cosmetic unless the temp directory fills up.
Source
Thrown at compat/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java:172
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.");
}
}
public static boolean empty(String value) {
return value == null || value.isBlank();
}
@OverrideView on GitHub (pinned to e4093d4e12)
Solutions
- Exclude the local repository and temp directory from antivirus real-time scanning
- Give each concurrent build its own repository: mvn -Dmaven.repo.local=$PWD/.repo ...
- Treat the warning as harmless: deleteOnExit removes the file when the JVM exits
- If temp files accumulate, schedule an offline cleanup of the affected directories
Defensive patterns
Strategy: fallback
Validate before calling
lsof +D ~/.m2/repository 2>/dev/null | head # who holds local-repo files right now
Prevention
- Exclude the local repository and temp directories from antivirus real-time scans
- Give each parallel build its own repository via -Dmaven.repo.local
- Close IDEs during heavy CLI builds on Windows
When it happens
Trigger: Another process holds the temporary file open at cleanup time: antivirus real-time scanning, a second concurrent Maven or IDE build using the same local repository, or a file indexer.
Common situations: Windows with Defender scanning ~/.m2/repository; parallel CI jobs sharing one -Dmaven.repo.local; Eclipse or IntelliJ indexing while a CLI build runs.
Related errors
- Repository list contains duplicate entries. Each repository
- Repository list contains null entries. All repository entrie
- groupId can neither be null, empty nor blank
- artifactId can neither be null, empty nor blank
- version can neither be null, empty nor blank
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/2617d1fda9113395.
Report an issue: GitHub.