{"record":{"id":"2617d1fda9113395","repo":"apache/maven","slug":"the-artifactid-cannot-be-empty","errorCode":null,"errorMessage":"The artifactId cannot be empty.","messagePattern":"The artifactId cannot be empty\\.","errorType":"validation","errorClass":"InvalidArtifactRTException","httpStatus":null,"severity":"warning","filePath":"compat/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java","lineNumber":172,"sourceCode":"        if (classifier == null) {\n            classifier = artifactHandler.getClassifier();\n        }\n\n        this.classifier = classifier;\n\n        this.optional = optional;\n\n        validateIdentity();\n    }\n\n    private void validateIdentity() {\n        if (empty(groupId)) {\n            throw new InvalidArtifactRTException(\n                    groupId, artifactId, getVersion(), type, \"The groupId cannot be empty.\");\n        }\n\n        if (empty(artifactId)) {\n            throw new InvalidArtifactRTException(\n                    groupId, artifactId, getVersion(), type, \"The artifactId cannot be empty.\");\n        }\n\n        if (empty(type)) {\n            throw new InvalidArtifactRTException(groupId, artifactId, getVersion(), type, \"The type cannot be empty.\");\n        }\n\n        if ((empty(version)) && (versionRange == null)) {\n            throw new InvalidArtifactRTException(\n                    groupId, artifactId, getVersion(), type, \"The version cannot be empty.\");\n        }\n    }\n\n    public static boolean empty(String value) {\n        return value == null || value.isBlank();\n    }\n\n    @Override","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java#L154-L190","documentation":"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.","triggerScenarios":"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.","commonSituations":"Windows with Defender scanning ~/.m2/repository; parallel CI jobs sharing one -Dmaven.repo.local; Eclipse or IntelliJ indexing while a CLI build runs.","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"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"lsof +D ~/.m2/repository 2>/dev/null | head   # who holds local-repo files right now","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["maven","temp-files","file-lock","cleanup","maven-compat"],"backgroundTag":"file-locked","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}