{"record":{"id":"efe46cbf6e658ab4","repo":"apache/maven","slug":"error-copying-temporary-file-to-the-final-destinat","errorCode":null,"errorMessage":"Error copying temporary file to the final destination: \" + e.getMessage()","messagePattern":"Error copying temporary file to the final destination: \" \\+ e\\.getMessage\\(\\)","errorType":"exception","errorClass":"TransferFailedException","httpStatus":null,"severity":"error","filePath":"compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java","lineNumber":468,"sourceCode":"\n            // The temporary file is named destination + \".tmp\" and is done this way to ensure\n            // that the temporary file is in the same file system as the destination because the\n            // File.renameTo operation doesn't really work across file systems.\n            // So we will attempt to do a File.renameTo for efficiency and atomicity, if this fails\n            // then we will use a brute force copy and delete the temporary file.\n            if (!temp.renameTo(destination)) {\n                try {\n                    Files.copy(\n                            temp.toPath(),\n                            destination.toPath(),\n                            StandardCopyOption.REPLACE_EXISTING,\n                            StandardCopyOption.COPY_ATTRIBUTES);\n\n                    if (!temp.delete()) {\n                        temp.deleteOnExit();\n                    }\n                } catch (IOException e) {\n                    throw new TransferFailedException(\n                            \"Error copying temporary file to the final destination: \" + e.getMessage(), e);\n                }\n            }\n        }\n    }\n\n    //\n    // Publisher\n    //\n    @Override\n    public void putArtifact(\n            File source, Artifact artifact, ArtifactRepository deploymentRepository, TransferListener downloadMonitor)\n            throws TransferFailedException {\n        putRemoteFile(deploymentRepository, source, deploymentRepository.pathOf(artifact), downloadMonitor);\n    }\n\n    @Override\n    public void putArtifactMetadata(File source, ArtifactMetadata artifactMetadata, ArtifactRepository repository)","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java#L450-L486","documentation":"Error \"Error copying temporary file to the final destination: \" + e.getMessage()\" thrown in apache/maven.","triggerScenarios":"Thrown at compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/DefaultWagonManager.java:468 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}