Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
2.0.7
-
None
-
None
Description
When Maven is used in another long-running process (in this case Hudson), File.deleteOnExit() is not run early enough, so we end up accumulating insane amount of temporary files. DefaultWagonManager in particular does that a lot, even though (at least in some cases) the file could have been deleted explicitly.
For example, in the putRemoteFile method, the code reads as follows,
// We do this in here so we can checksum the artifact metadata too, otherwise it could be metadata itself for ( Iterator i = checksums.keySet().iterator(); i.hasNext(); ) { String extension = (String) i.next(); // TODO: shouldn't need a file intermediatary - improve wagon to take a stream File temp = File.createTempFile( "maven-artifact", null ); temp.deleteOnExit(); FileUtils.fileWrite( temp.getAbsolutePath(), (String) sums.get( extension ) ); wagon.put( temp, remotePath + "." + extension ); }
... butI don't see why the temporary file cannot be deleted after the put method, or at least at the end of the method, after the Wagon component is released.
Attachments
Issue Links
- relates to
-
MNG-4543 Cleanup tmp files created by DefaultWagonManager
- Closed